View Full Version : getting max and min coordinate values after using glVertex* several times
08-05-2003, 02:53 AM
For example We use glVertex* 10 times and after that we want to know what were the maximum and minimum values of coordinates used in x,y,z direction. Is it possible to get such information from OpenGL?
Is so is it possible to 'tell' opengl state machine: 'reset old max and min values and start checking it from now'?
08-05-2003, 03:51 AM
AFAIK, no. maybe using vp ...
is it possible to have persistant registers ?
08-05-2003, 05:13 AM
instead of throwing OpenGL numbers, use variables. then, after the glVertex* calls, you have 10 variables...and from these you can find the min and max.
08-05-2003, 07:33 AM
//set the value of the ten verts with the tenVerts = x coord;
tenVerts = y coord;
tenVerts = z coord;
// after display
for(int i = 0; i < 3; i++)
case0: curMax=minXVal;// suply min x val
case1: curMax=minYVal;// suply min y val
case2: curMax=minZVal;// suply min z val
for(int k = 0; k < 9; k++)
if(tenVerts[k][i] > curMax)
curMax = tenVerts[k][i];
08-05-2003, 06:25 PM
Thank You for your help,
I know i can remember values and later calculate it but im writting library based on OpenGL so i must allow other user which will use this library for freely using glVertex* (without limits and inconveniences like 'remember your value in the table') and thats why i wanted to take these informations after use glVertex* from OpenGL.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.