# OpenGL I'm new to OpenGL

This topic is 2559 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm new to OpenGL in python.

I've manage to draw coordinates and put in a camera but the orientation seems off.

From what I've read it should be:

x +
|
/ - - - y +
/
z +

but it seems like it actually draws as

y +
|
/ - - - x +
/
z +

here's what I've got, maybe I've got it implemented backwards?

 def gfxInit(): glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) #clear the color and depth buffers glLoadIdentity() #clear current (in this case, modelview) matrix to the identity matrix gluLookAt(3,3,3, 0,0,0, 0,1,0) # at 3,3,3 looking at origin 0,0,0 with vector pointing up 0,1,0 def gfxShowCoords(): # Cartesian: draw X, Y, Z glBegin(GL_LINES) # draw positive X glColor3f(1,0,0) # red glVertex3f(0,0,0) # origin glVertex3f(2,0,0) # draw positive Y glColor3f(0,1,0) # green glVertex3f(0,0,0) # origin glVertex3f(0,2,0) # draw positive Z glColor3f(0,0,1) # blue glVertex3f(0,0,0) # origin glVertex3f(0,0,2) glEnd() 

I also want to draw cube "tiles" that are 1 h x 1 w x 1/2 high -- these should be wireframe for now but later I want to make them texture mapped. Better to draw them as lines, quads or another method?

Thanks! Edited by greentiger

##### Share on other sites
X is right, z is in/out, y is up
Many newer cards don't support quads, so you'll need to use line strips or textures on solid cubes

##### Share on other sites

X is right, z is in/out, y is up
Many newer cards don't support quads, so you'll need to use line strips or textures on solid cubes

So how would I draw the above dimenions as a cube with the intention to texture it later?

##### Share on other sites
Just use triangles. You may be able to make a cube using a triangle strip, but I'm not sure if there's some order that would work.
gltranslatef(positionofcube)
glbegin(gl triangles)
glvertex3f for each point

If you need help with the actual points, I can post a better example, but I'm on my cell right now

##### Share on other sites

Just use triangles. You may be able to make a cube using a triangle strip, but I'm not sure if there's some order that would work.
gltranslatef(positionofcube)
glbegin(gl triangles)
glvertex3f for each point

If you need help with the actual points, I can post a better example, but I'm on my cell right now

after reading your post and googl'ing it's odd that they would trim some of the basic commands--but i guess it would help trim their bulkiness and i guess since quads are made of two triangles it doesn't matter i suppose. still -- odd ...

1. 1
2. 2
3. 3
4. 4
frob
13
5. 5

• 16
• 13
• 20
• 12
• 19
• ### Forum Statistics

• Total Topics
632170
• Total Posts
3004550

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!