Uflenu
05-14-2001, 06:03 AM
Hi everybody,
I'm using glReadPixels and gluUnProject to get the 3D coordinates of all the pixels of a picture (my purpose is to calculate a simulated sonar profile of the scene).
gluUnProject is time consuming, and returns absolute coordinates which I need to convert into new coords relative to the viewpoint.
I guess that this transformation is made twice (once, reversed, inside of the unproject subroutine and once by myself). I think that I would save time if I could directly unproject the winZ, winY, winZ into the viewpoint coordinates system.
The 2 ideas I have are:
- do the unproj myself with a simplified algorithm
- pass modified proj and/or model matrices to the gluUnProject routine
Could somebody help in any of these directions ?
Thanks,
Eric
I'm using glReadPixels and gluUnProject to get the 3D coordinates of all the pixels of a picture (my purpose is to calculate a simulated sonar profile of the scene).
gluUnProject is time consuming, and returns absolute coordinates which I need to convert into new coords relative to the viewpoint.
I guess that this transformation is made twice (once, reversed, inside of the unproject subroutine and once by myself). I think that I would save time if I could directly unproject the winZ, winY, winZ into the viewpoint coordinates system.
The 2 ideas I have are:
- do the unproj myself with a simplified algorithm
- pass modified proj and/or model matrices to the gluUnProject routine
Could somebody help in any of these directions ?
Thanks,
Eric