
class member question.
Hi all...im not sure if this is the right forum for this..but i am using OGL
...well, I have a function ''cube'' that requests 4 parameters, an object name, x,y,and z values. (cube(int objname,int x,int y, int z) Then I have a class that holds all of its coordinates...It works fine and dandy cept I cant get it to interpret the variable ''objname'' as an actual number. So my class ''entity'' ill do ''entity objname'' ''objname.x=x....etc. But, obviously it reads ''objname'' as the actual name, and not the variable stored in side. So, could I use a pointer somehow to get the value inside ''objname''? If not, what else should I try? thanks
McDougal...DUCK McDougal

http://www.labino.net
heres one of the functions:
McDougal...DUCK McDougal
void pyramid(char objnum, int xtrans, int ytrans, int ztrans)
{
//THIS IS WHERE THE PROBLEM STARTS:
entity1 objnum; //entity1 is the name of the class
objnum.transx=xtrans;
objnum.transy=ytrans;
objnum.transz=ztrans;
//THIS IS WHERE THE PROBLEM ENDS
glTranslatef(xtrans,ytrans,ztrans);
glBegin(GL_TRIANGLES); // Start Drawing The Pyramid
glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Front)
glVertex3f(-1.0f,-1.0f, 1.0f); // Left Of Triangle (Front)
glVertex3f( 1.0f,-1.0f, 1.0f); // Right Of Triangle (Front)
glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Right)
glVertex3f( 1.0f,-1.0f, 1.0f); // Left Of Triangle (Right)
glVertex3f( 1.0f,-1.0f, -1.0f); // Right Of Triangle (Right)
glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Back)
glVertex3f( 1.0f,-1.0f, -1.0f); // Left Of Triangle (Back)
glVertex3f(-1.0f,-1.0f, -1.0f); // Right Of Triangle (Back)
glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Left)
glVertex3f(-1.0f,-1.0f,-1.0f); // Left Of Triangle (Left)
glVertex3f(-1.0f,-1.0f, 1.0f); // Right Of Triangle (Left)
glEnd(); // Done Drawing The Pyramid
glLoadIdentity();
}
McDougal...DUCK McDougal
http://www.labino.net
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement