PDA

View Full Version : Tranformation Results



adamv2
02-16-2004, 10:25 AM
If I use glRotate, glScale, or any of the other functions to perform a transformation in OpenGL, is there anyway to get the results of the matrix multiplication (i.e. the transformed verticies) returned back to me, or can they only be sent down the pipeline from there?

Thanks

02-16-2004, 01:38 PM
Not in the brain-dead simple "tell me what you're thinking" way, no. There *are* ways to do that sort of thing, but they'll not be appropiate for what you're doing.

The easiest thing to do is to find yourself a vector library and apply the same operations you send to OpenGL on an appropiate matrix - this keeps the end result client-side and easily accessible.

This isn't, however, something to do for more than just debug. If you're wanting to do this kind of thing at run-time there's probably a better way of doing whatever it is you're trying to do. If this is the case, please post details!

adamv2
02-16-2004, 02:20 PM
The reason I asked,was because I thought I could use those functions to make my really fast GPU do it, well, really fast.

Bode
02-16-2004, 03:30 PM
Hi...

Do you mean something like glGetDoublev(GL_MODELVIEW_MATRIX, double *ptr) that populates the ptr with the values of the modelview matrix?

Bode

Jan
02-17-2004, 12:57 AM
What Bode said should work, BUT it wonīt be "really fast".

Either your GPU does it, but then you will slow your app down, due to syncronizing the CPU and the GPU, or the functions wonīt be processed by your GPU, at all, but the driver lets your CPU do it. Then their still might be a syncronizing issue AND itīs still done by your CPU.

Jan.