I’m looking into rendering the flight plan waypoints and I’m having some trouble getting the geometry to display in Flightgear.  Just to test things out I’m catching the waypoints as they’re loaded in by FGAIFlightPlan, creating geometry and positioning it using the waypoint’s lat/lon/altitude and the SGModelPlacement class.  Looking at other examples from FG, this seems reasonable but it looks like I’m missing something because the teapot is never visible.  That’s not totally true, if I don’t call update(…) the teapot is visible but always appears in the wrong spot with incorrect orientation.  Any help would be appreciated.  Thanks!  Here’s some code:

 

ssgBranch* point_branch = new ssgBranch();

ssgaTeapot* cube = new ssgaTeapot();

 

sgVec4 colour = {0.0,1.0,0.0,1.0};

cube->setColour(colour);

 

point_branch->addKid(cube);

point_branch->ref();

 

SGModelPlacement* mp_waypoint = new SGModelPlacement();

 

mp_waypoint->init(point_branch);

 

mp_waypoint->setElevationFt(waypoint->altitude);

mp_waypoint->setLatitudeDeg(waypoint->latitude);

mp_waypoint->setLongitudeDeg(waypoint->longitude);   

mp_waypoint->setOrientation(0.0,0.0,0.0);

 

Point3D scenery_center = globals->get_scenery()->get_center();

mp_waypoint->update(globals->get_scenery()->get_center() );

 

mp_waypoint->setVisible(true);

 

globals->get_scenery()->get_scene_graph()->addKid(mp_waypoint->getSceneGraph());

_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to