How to place planes

Problems with Canvas, OpenGL, etc...

How to place planes

Postby AedonEtLIRA » Wed Jan 19, 2011 6:10 pm

I have created a plane class and no am trying to create 9 in the shape of a diamond (3 layers of three. top pitched in towards the top, middle just flat and the bottom tilted in towards the bottom). How ever as I walk through the loop placing thread then rotate the world, the planes end up skewed. Any Ideas?
Thanks
~Aedon

Code: Select all

// Top Layer
mGL.glRotatef(dyaw, 0, 1f, 0);
mGL.glRotatef(dpitch, 0, 0, 1f);
mGL.glTranslatef(0, h + spacing, 0);
mPanels[0].drawColorful(mGL);
mGL.glRotatef(dyaw, 0, 1f, 0);
mPanels[1].drawColorful(mGL);
mGL.glRotatef(dyaw, 0, 1f, 0);
mPanels[2].drawColorful(mGL);
// Middle Layer
mGL.glRotatef(dyaw, 0, 1f, 0);
mGL.glRotatef(-dpitch, 0, 0, 1f);
mGL.glTranslatef(0, -(h + spacing), 0);
mPanels[3].drawColorful(mGL);
mGL.glRotatef(dyaw, 0, 1f, 0);
mPanels[4].drawColorful(mGL);
mGL.glRotatef(dyaw, 0, 1f, 0);
mPanels[5].drawColorful(mGL);
// Bottom Layer
mGL.glRotatef(dyaw, 0, 1f, 0);
mGL.glRotatef(-dpitch, 0, 0, 1f);
mGL.glTranslatef(0, -(h + spacing), 0);
mPanels[6].drawColorful(mGL);
mGL.glRotatef(dyaw, 0, 1f, 0);
mPanels[7].drawColorful(mGL);
mGL.glRotatef(dyaw, 0, 1f, 0);
mPanels[8].drawColorful(mGL);

Walk with purpose, and build something.
User avatar
AedonEtLIRA
Senior Developer
Senior Developer
 
Posts: 146
Joined: Wed Jul 28, 2010 11:52 pm

Top

Re: How to place planes

Postby AedonEtLIRA » Wed Jan 19, 2011 7:28 pm

Never mind found a better tutorial at http://insanitydesign.com/wp/projects/n ... oid-ports/
Walk with purpose, and build something.
User avatar
AedonEtLIRA
Senior Developer
Senior Developer
 
Posts: 146
Joined: Wed Jul 28, 2010 11:52 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 1 guest