First Renderings

Filed under: Engine — yasunobu13 at 1:23 am on Tuesday, October 18, 2005

Engine Render

Not much to look at, but it is very promising. My first test being a bunch of colored lines in a cube with interactive camera is both boring and quick to ignore, but for me it means that everything is running smoothly. The entire setup consists of creating 3 materials (red, green and blue), creating three translates (translateX, translateY and translateZ), and creating three grids of lines to be drawn (linesXY, linesXZ, linesYZ). once that is done, it’s tied together and displayed nicely. The new scene graph is working out beautifully by the way.



SceneNode* root = new SceneNode();

translateX->addDrawable(linesYZ);
translateY->addDrawable(linesXZ);
translateZ->addDrawable(linesXY);

red->addDrawable(linesYZ);
green->addDrawable(linesXZ);
blue->addDrawable(linesXY);

red->addChild(translateX);
green->addChild(translateY);
blue->addChild(translateZ);

root->addChild(red);
root->addChild(green);
root->addChild(blue);

GLRenderer* r = new GLRenderer(
new FPSCameraManip(new PerspectiveCamera()),
root);

GLUTWindowManager* wm = new GLUTWindowManager(&argc, argv, r);

wm->toggleFullscreen();
wm->mainLoop();

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>