PDA

View Full Version : Returning Vertex Values



lowzie
03-21-2003, 12:17 PM
I'm creating a C++ class to draw a human hand. I'm doing this from scratch using C++. Each vertex on the model needs to be accessable for changing its colour and getting its current position. The colour is easy enough as I can store all the values in an RGBA array and write a set method. The problem lies with obtaining the vertex position values. Being a hand model certain areas like the finger tips will have had several transformations applied to them and since this is an object existing in a program it had no knowledge of yet more transformations could have been applied to the whole object. Is there anyway in OpenGL to retreive the position values of a vertex as it stands when it has been drawn?

ScottManDeath
03-21-2003, 12:30 PM
Hi


the feedbackbuffer mechanism lets you get transformed vertices and colors ...
look for glFeedbackBuffer

Bye
ScottManDeath

lowzie
03-21-2003, 01:59 PM
Originally posted by ScottManDeath:
Hi


the feedbackbuffer mechanism lets you get transformed vertices and colors ...
look for glFeedbackBuffer

Bye
ScottManDeath

You may have saved my life, thankyou!

knackered
03-21-2003, 04:41 PM
If you're "doing this from scratch" then DO NOT USE OPENGL MATRIX MANIPULATION FUNCTIONS!
The only GL matrix functions you should be using are glLoadMatrix or glMultMatrix - you should manually construct your matrices within your own classes, otherwise you're working in the dark.
Believe me, you are going to need more and more information about your transform hiearchy the more features you add to your C++ class. To rely on OpenGL to do this basic linear algebra for you is crazy.

jwatte
03-21-2003, 06:11 PM
I don't quite understand the suggested set-up here.

You have a model of the hand. You pose the model (bend bones, and whatnot). You render the vertices. To render the vertices, you have to know where they are, so presumably you already wrote code to skin the hand model to the posed skeleton?

If you didn't, then perhaps that would be the easiest way to get at the data?