-
pixel to vertex data
I need to access data linking a pixel on the rendered image to the vertex or closest vertex in the 3D model from which it was rendered. I don't know if this is a begginner's question or not, but I am definetly new the openGL. Is there any support for this sort of thing?
-
Member
Regular Contributor
Re: pixel to vertex data
I haven't done this myself, but I think you'd have to do the following:
1. Render the scene for feedback mode - with separate IDs per triangle (or object)
2. Use gluUnproject on the pixel you're interested in. This should give you an approximation of the 3D position of the pixel.
3. Retrieve the pixel's object ID
4. Cycle through all vertices belonging to the triangle (or object), and pick the nearest.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules