Hi Callum,

I'm afriad there isn't an example of how to do this.  It is possible
and some users have implemented it in the past.  Hopefully they spot
your post and volunteer some code...

The basic principle will be that using a ray intersection find the
triangle hit, and from this get the tex coordinates for this hit
point.  Then find the current textures that will be attached/ihnerited
down to this hit drawable, get the image from the texture, then
compute the tex coord offset into the image and get and decode the
pixel.

Its certainly a nice exercise to leave the reader, I'm afriad I'm
waaay to busy to do fine grained help on this one.

Robert.


On 11/15/06, Callum Prentice <[EMAIL PROTECTED]> wrote:
I'd like to be able to pick a point off of a textured rectangle and get back 2 
values that represent
a pixel offset into the texture. This could either be 0..texture_scale in each 
direction or an
actual pixel offset 0..num_pixels_in_texture_each_direction

Is this possible with OSG and if so, is there any sample code to look at?

The texture on this rectangle is created dynamically and updated on a regular 
basis - is
osgtexturetectangle the best example to pull apart to find out how I can do 
this?

--Cal.
_______________________________________________
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/

Reply via email to