Original Post
Hello, I want to write a scene graph. I read lots of resources about Scene Graph. And i know how to implement it. But when people write something about Nodes, like i really don't understand what is it. Is that a part of Scene Graph? And my second question is: For example i wrote a code: For using SceneGraph in my Application i need to do something like that: ? And if i am right about these questions, nodes need to have position and orientation right (excluding SceneGraph class itself) ? Thanks, Kasya
class SceneGraph {/* Code Inside */};
class SomeNode1 {
/* If my previous question is right */
/* Code inside */
}
SceneGraph * scene = new SceneGraph;
SomeNode1 * car = new SomeNode1;
SomeNode2 * node2 = new SomeNode2;
SomeNode3 * node3 = new SomeNode3;
void CApp::Init() {
scene->AddChild(node1);
scene->AddChild(node2);
scene->AddChild(node3);
}
void CApp::Render() {
scene->Update();
//Example for using it Dynamic:
if(i_destroyed_the_car) {
scene->DeleteNode(car);
}
if(i_create_the_car) {
scene->AddNode(car);
}
}
void CApp::Release() {
scene->ReleaseAllChildren();
}