Hello Jie Liu, Jie Liu wrote: > I have been reading OpenSG docs and source codes all these days, and > tried some demo programs at the same time. > > However, I think it is very complicated for me to understand it, and > master it in a short period.
if you let us know what you want to do we might be able to point you to relevant examples or similar code so that you can focus on understanding what you need. > It heavily relied on C++ template features and is grounded in pattern > design concepts. -- that really confuses me a lot~ > > I can write some simple codes according to examples, but in most cases, > I can not figure out what my application is really doing... most examples are very similar in structure: they build a scene graph and then go into a loop updating the camera beacon based on user input (to change the point of view) and redraw the graph. > Finally, would anyone like to tell me, how RenderAction takes effect? it is applied to the scenegraph inside the SimpleSceneManager::redraw function or as you can see in the example that does not use SSM by calling window->render(renderAction). Or where you asking how it works? > When I check the example program, Without_ssm.cpp (without simple scene > manager), the scene is organized in this way: > > [Node: Scene Root] > | > | > [Node: Light] ----> NodeCores: DirectionalLight ----> NodeCores: > diffuse, ambient, specular... > | | > | |----> Member Attribute: SField > LightBeacon ----> NodeCores: Transformations (Position and Direction?) > | > | > | > [Node: Geometry] ----> NodeCores: Torus > > where LightBeacon is a NodePtr. However it is not added to the scene > graph as a child node, but as the member attribute of > DirectionalLight...Weird! hm, quoting from <http://opensg.vrsource.org/trac/wiki/Tutorial/OpenSG1/Light>: "The location of the light source in the scene graph defines its area of influence: only the descendants of the light source are lit. This generally means that light sources are located at the top of the graph, to influence a large part of it. The position and orientation of the light source is defined by the Node referenced as the beacon. Light sources are located at the origin of the beacon's coordinate system" In other words the light is placed relative to the beacon's coordinate system origin. If the beacon is not attached to the rest of the scenegraph its coordinate system is the same as the world coordinate system - you could get the same effect by setting the root as beacon. Cheers, Carsten ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
