I have a hundred or more points and i need the camera to see them all.
I assume I need a way to find out the constraints of several points in space and then use the front face as the screen for the camera, ie...
struct typBox glBox
double xMax = point.x, xMin = point.x;
double yMax = point.y, yMin = point.y;
double zMax = point.z, zMin = point.z;
for(int i = 1; i < NUM_OF_POINTS; i++)
if( xMax < point[i].x ) xMax = point[i].x;
if( xMin > point[i].x ) xMin = point[i].x;
if( yMax < point[i].y ) yMax = point[i].y;
if( yMin > point[i].y ) yMin = point[i].y;
if( zMax < point[i].z ) zMax = point[i].z;
if( zMin > point[i].z ) zMin = point[i].z;
b.top = yMax;
b.right = xMax;
b.front = zMax;
b.height = yMax - yMin;
b.width = xMax - xMin;
b.depth = zMax - zMin;
But you get the idea...
What i need, however, it to specify 2 vectors, up and forward.
(this is not a very good description but here goes)
The box returned will have 4 edges parallel with forward 4 edges parallel with up and 4 edges perpendicular to the plane (up, forward).
I hope you understand.
This changes the defenition of a box and the simple ...
if( xMax < point[i].x )
... much more complicated.
I'm using OpenGL and i need a fast method of doing this. Can anyone suggest something?
What does God need with a starship?