Hi

I`m wanting to know how I could plot coordinates, say some one draws a simple cube
in inches for me and I do not know the size of the cube and I want have a ball or something go around the inside of the cube.

Also I want it to be very accurate within
tenths (.0001),So how do I get the boundry
of the cube that has been pre-drawed so that I can make the ball go around the inside of the cube and record the xyz moves.

Thanks

Soeery, but what do u mean by “someone draws a simple cube in inches for me” ???

Are you using a DLL to draw the cube ??

What you are asking for it’s quite impossible to do without the vertex coords of the cube, keep in mind that what you see on screen is just a 2d projection.

Be more precise, and someone could be able to help you.

basically, you’ll need to store the x,y,z vertices of the cube and use those to test the x,y,z position of the ball.

b

What I mean is that someone draws the cube
on a cad system like unigraphics which uses open GL to render 3d models and wire frames its a drawing API that is used to design.

I`m wanting to know is there any way that I can load the the design (file) and some how
figure out the xyz coordinates of the cube does open gl support this.

opengl will not load the file for you. you’ll have to do that on your own (fopen, ifstream). if you know the format of the file, just make some type of vertex structure and build an array of them from the file. then you’ll have your data ready whenever you want it.

b

This question has pop-up before about units of measurement in openGL.
First you must understand that openGL does not store objects as set standard of measurement, like meter’s or inches. You should treat openGL and the screen as relative coordinates. Just like the fact you cannot display a 100-inch cube on your 15” monitor in real measurements!!

Take the cube drawn by your friend on his CAD software: It has a file with the following x,y,z vectors; 100.000, 100.000, 100.000, but your openGL screen is a 10, 10, 10 in size. You must translate his data by ether scaling or translating the data to an openGL unit. Since your cube is a 10 times larger then the screen, we can ether use glScale or divide the data to give us a proportional image on the screen. We then use our new object data to create the boundaries for the cube.

For just bouncing a ball around the screen there is no need to use a .0001 accuracy, since the viewer will not see any difference below 1.0 depending on the screen settings!!!

Originally posted by flyer++:
[b]Hi

I`m wanting to know how I could plot coordinates, say some one draws a simple cube
in inches for me and I do not know the size of the cube and I want have a ball or something go around the inside of the cube.

Also I want it to be very accurate within
tenths (.0001),So how do I get the boundry
of the cube that has been pre-drawed so that I can make the ball go around the inside of the cube and record the xyz moves.

Thanks [/b]

OpenGL only draw’s the graphics to the screen, you will have to look at the data in the file created by the CAD program.
Then convert the data to a format opengl can understand.

Originally posted by flyer++:
[b]
What I mean is that someone draws the cube
on a cad system like unigraphics which uses open GL to render 3d models and wire frames its a drawing API that is used to design.

I`m wanting to know is there any way that I can load the the design (file) and some how
figure out the xyz coordinates of the cube does open gl support this. [/b]

Thanks everybody

The reason I need the accuracy is because I`m a cnc machinist and I`m wanting to make a program that will take any design and load it in and scale it down so that it fits the screen and get the xyz coordinates of any part so that I can make tool paths that are accurate for the cnc machine to make parts so that I dont have to program them every time. To understand a little bit of what I`m talking about go to [www.mastercam.com](http://www.mastercam.com) that will give you an idea of what I`m talking about plus you might learn other uses of open gl

thanks again