Harold CPP/sky.cc
/// Creates a new sky stroke mesh by projecting each vertex of the 2D mesh
/// onto the sky dome and saving the result as a new 3D mesh.
Creates a new sky stroke mesh by projecting each vertex of the 2D mesh
onto the sky dome and saving the result as a new 3D mesh.
Creates a new sky stroke mesh by projecting each vertex of the 2D mesh onto the sky dome and saving the result as a new 3D mesh .
void Sky::AddSkyStroke(const Matrix4 &view_matrix, const Matrix4 &proj_matrix,
                       const Mesh &stroke2d_mesh, const Color &stroke_color)
{
    Mesh m = stroke2d_mesh;
    struct SkyStroke new_stroke; 
    std::vector<Point3> newpoints;
    Point3 new_s;
    for(int i  = 0; i < m.num_vertices(); i++){
        ScreenPtToSky(view_matrix, proj_matrix, Point2(m.vertex(i)[0], m.vertex(i)[1]), &new_s);
        newpoints.push_back(new_s);
    }
    m.SetVertices(newpoints);
    new_stroke.mesh = m;
    new_stroke.color = stroke_color;
    strokes_.push_back(new_stroke);
}
void Sky :: AddSkyStroke ( const Matrix4 & view_matrix , const Matrix4 & proj_matrix , const Mesh & stroke2d_mesh , const Color & stroke_color ) { Mesh m = stroke2d_mesh ; struct SkyStroke new_stroke ; std :: vector < Point3 > newpoints ; Point3 new_s ; for ( int i = 0 ; i < m . num_vertices ( ) ; i ++ ) { ScreenPtToSky ( view_matrix , proj_matrix , Point2 ( m . vertex ( i ) [ 0 ] , m . vertex ( i ) [ 1 ] ) , & new_s ) ; newpoints . push_back ( new_s ) ; } m . SetVertices ( newpoints ) ; new_stroke . mesh = m ; new_stroke . color = stroke_color ; strokes_ . push_back ( new_stroke ) ; }
Creates a new sky stroke mesh by projecting each vertex of the 2D mesh
onto the sky dome and saving the result as a new 3D mesh.
Creates a new sky stroke mesh by projecting each vertex of the 2D mesh onto the sky dome and saving the result as a new 3D mesh .