I've done this for a customer. Unfortunately, the code belongs to them and I can't share it, but I can tell you how the algorithm works, and let you struggle with the nitty-gritty.
- Use any of the osg examples that use intersecting or picking to select a point on your model.
- On a mouse click, drill down until you determine the Geometry and triangle you have intersected.
- Extract the current texture image by reading it back into memory.
- (this is the tricky part): Determine the S and T coordinates of your intersection.
- Alter the texel in the texture image at the resulting U,V texel coordinates where
U = <texture width> * S
V = <texture height> * T
V = <texture height> * T
- Call setImage() on the texture, which will result in it being subloaded on the next draw.
-don
On 7/26/06, Aaron Birenboim <[EMAIL PROTECTED]> wrote:
We will wish to "paint" an model in OSG.
i.e. We have a plain model of a race car, and wish to apply
fancy sign-paints. Logos, etc.
Where should I start reading to find out the most straightforward
Way to "paint" a model under OSG.
Does it need to be done before the OSG level?
If so... What model format is recommended to do this?
(We will want to CHANGE the paint as the app runs.
I was simplifying a scientific visualization app with
the race car example.)
Aaron Birenboim
Tau Technologies LLC
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
