Frank Sullivan wrote:
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?
If the texture matrix is in the shared part of the subgraph, then the same
texture matrix will be used for both instances -- that is sort of the definition
of sharing. You have correctly observed that making a hard copy will eliminate
both the sharing and the issue you've encountered.
Another solution would be to use shaders to render the wheels. Each matrix
transform would specify a uniform to transform the texture that's applied to the
wheel texture coordinates.
--
-Paul Martz Skew Matrix Software
http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org