View Full Version : inputdata xyx -> mapping -> screen

08-05-2010, 05:36 AM
Hi first of all let me tell you what we have today:
We get input-data for a grid for instance 100x100 points...

These grids have extreme-values max/min - x,y,z...

In some cases these values will be from 0-100 but in other cases from 53000 to 64000...(or other extreme-values).

Today we have a mapping-util that takes the original value and returns a value between 0-> screen-width and 0-screen-height, so that no matter how big the grid is it will fit perfectly on to the screen. This operation is done during init of the rendering..

Is there a smart way of making the camera do this? So that the camera will fit the grid perfectly to the screen..
We use glOrtho for viewing...

08-05-2010, 06:42 AM
What about this :
- when loading file, scan for min/max values on x,y,z
- when displaying, use glOrtho(minx,maxx,miny,maxy,minz,maxz);

08-05-2010, 10:01 AM
Thanks, i'll try it out :)