PDA

View Full Version : Help, please, I will love you forever.



Crowz
04-18-2012, 05:45 PM
I am having the most unbearable time just making a simple room.
100x100x100

gl.glBegin(GL2.GL_QUADS);/* f1: front */
gl.glNormal3d(-100.0, 0.0, 0.0);
gl.glVertex3d(-100.0,0.0f,-100.0);
gl.glVertex3d(100.0,0.0,100.0);
gl.glVertex3d(0.0,0.0,100.0);
gl.glVertex3d(0.0,0.0,0.0);
gl.glEnd();

I have six of those methods, and no matter how I change them, it does nothing. This is what I see:
http://i.imgur.com/vgeGH.png

tonyo_au
04-18-2012, 11:57 PM
Your coordinates arent't right

I suggest you draw a square on a piece of paper and pretend it is on xy-graph paper and write the x and y coordinates on each corner.

This is your front face with z = 0;
write the code to render this

this is your back face with z = -100.

write the code to render this

Draw that first then think about the top and bottom as being on an xz-graph with y = 0 and y = 100

write the code to render this

combine the code to render to top front back top and bottom

then the do the sides.