R: [Plib-users] scenegraph structure
Brought to you by:
sjbaker
From: Paolo L. <p.l...@ci...> - 2005-12-05 09:04:14
|
-----Messaggio originale----- Da: pli...@li... [mailto:pli...@li...] Per conto di deepha sv Inviato: sabato 3 dicembre 2005 6.37 A: pli...@li... Oggetto: [Plib-users] scenegraph structure > hi, > I am using a simulation software ,as we are reading the data file = and storing into a scenegraph tree structure=20 >=20 > 1. how are we actually taking the data from the scenegraph and placing = it in frustrum. By means of the camera positioning and actual drawing. sgCoord camera; // has xyz (camera position) and hpr (camera = orientation) fields // ... // set camera.xyz and camera.hpr as your camera motion model // ... ssgSetCamera( &camera ); ssgCullAndDraw( scene ); // scene is your scene graph root Anyway there are other camera placement approaches in SSG, e.g. by 4x4 camera matrix, or by a LookAt approach (the one showed is somehow a = LookFrom instead). > 2. how and where , are we placing the frustum in scenegraph Where: at window resize time (i.e. within the resize callback if you're using Glut) How: ssgSetFOV( fov_x_deg, fov_y_deg ); // frustum hor & vert = field-of-view ssgSetNearFar( nnear, ffar ); // frustum near, far Or, if you need an explicit frustum control (calculating frustum params = it's up to you): ssgSetFrustum( left, right, bottom, top, near_clip, far_clip ); Modern SSG syntax want frustum things to be set as methods of a = ssgContext, and set it as current context. > 3. how the data from the frustum are rendered. The actual drawing occurs at the ssgCullAndDraw call. > for preparing scenegraph and rendering i am using plib library. Welcome on board. As usual with apparently simple questions I hope to have interpreted = your questions in the intended meaning. Greetings - Paolo Leoncini |