Drawing Help with Coordinates

BlitzMax Forums/OpenGL Module/Drawing Help with Coordinates

Jayjay(Posted 2011) [#1]
Hi Coders

Many thanks in advance for any help!

I need to draw some 'sized' rectangles, for example a rectangle that is 500mm x 2000mm.

I can do this in Ortho mode but I am not sure how to do this in perspective mode as when I do anything I draw disappears??? Vamoosh, nada, nothing.

I am using:

glFrustum 0,800,600,0,0.0, 100.0

Before I disappear to the bottom of my vodka bottle can anyone help..I guess I want to convert from

glBegin GL_LINES
glVertex2f 50,0
glVertex2f 100,0
glEnd

Which draws a line 50 long to the same using glVertex3f and still see it??


jkrankie(Posted 2011) [#2]
you need glvertex3f(x,y,z)in perspective mode. remember to set z to something in front of the camera.

Cheers
Charlie


Jayjay(Posted 2011) [#3]
Thanks Charlie, that was a mistake in my original post

the code shold read:

glBegin GL_LINES
glVertex3f 50.0,0.0,0.0
glVertex3f 550.0,0.0,0.0
glEnd

I need the lengths to be accurate as I also have polygons that have rounded corners and the arcs of the rounded corners need to join with the sides and hence have to be drawn at an accurate position!

In my simple mind this should draw a line that is 500 units (in my case mm) long.



However, when I do this I cannot see the line drawn?

How can I set the correct viewing matrix using perspective to be able to see this line in all its linear glory????

Thanks