Hello there,

Let's say I want two cars in the scene. What I currently do is I load the car 
file once, but I give it two matrix transform parents, like so:

 http://imgur.com/kuSBu.gif

This works well for me (the small graph stemming from the word 'car' is just 
there to emphasis that the car is actually a sub-tree of nodes and not a single 
object in of itself). 

The only problem is, what if I want these cars to move? As far as translating 
and rotating the cars, that's easy. I simply modify the matrix transforms, 
which I can do independently since they are separate objects.

But I want to make the wheels look as though they are turning as well. I 
accomplish this with a simple texture matrix. I simply find the node that 
represents each wheel, and I add a texture matrix to each of them that will 
slide the s/t coordinates of the wheels' textures so as to give the illusion 
that the wheels are turning.

This seems to work well also. Well enough for my purposes, anyway.

The problem is when I have two cars in the scene, and the graph looks like it 
does above, I can't turn the wheels on one car without turning them on the 
other as well.

Is the best solution to this to do a deep copy of the car's sub-graph rather 
than reusing the same sub-graph with two different matrix transforms?

Thank you!

Cheers,
Frank

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27893#27893





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to