Jiejie Zhu wrote:

Click a button, call things like this:
     root = SceneFileHandler::the().read("data/terrin.wrl");
Nothing changed.

--cut-------------------------
NodePtr root = Node::create();
mgr->setRoot(root);
// ...
root = SceneFileHandler::the().read("data/terrin.wrl");
--cut-------------------------

The SceneFileHandler creates a new Node (containing the loaded scene) which you assign here to the variable root. The SimpleSceneManager doesn't know about this new Node. That's why nothing is displayed.

Your solution (creating a Group core) is OK but you asked for a simpler way. Just tell the SimpleSceneManager about the new root node. :)

--cut-------------------------
NodePtr root = SceneFileHandler::the().read("data/terrin.wrl");
mgr->setRoot(root);
--cut-------------------------


Hope it helps,

Joerg.


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to