# Thread: how can I make solid and wire frame cube ?

1. ## how can I make solid and wire frame cube ?

how can I make solid AND wire frame cube ?

2. ## Re: how can I make solid and wire frame cube ?

if u can use glut call glutSolidCube(1) for solid and glutWireCube(1) for wire unitcube

3. ## Re: how can I make solid and wire frame cube ?

If you wanna draw your entire scene in wireframe you can use

Code :
`glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );`

4. ## Re: how can I make solid and wire frame cube ?

Hm... I am fighting with cube - left side must be always in the same place and right side can go up or down like in train or like in arm - my previous subject - so now I have found that code - two cubes, one has got angle 45 degrees and second - 45 degrees:
Code :
```glPushMatrix();
glTranslatef(0, 0, -70.0f);
glTranslatef (-1.0, 0.0, 0.0);
glRotatef (45, 0.0, 0.0, 1.0);
glTranslatef (1.0, 0.0, 0.0);
glPushMatrix();
glScalef (2.0, 0.4, 1.0);
glutWireCube (1.0);
glPopMatrix();

glPushMatrix();
glTranslatef(0, 0, -70.0f);
glTranslatef (-1.0, 0.0, 0.0);
glRotatef (-45, 0.0, 0.0, 1.0);
glTranslatef (1.0, 0.0, 0.0);
glPushMatrix();
glScalef (2.0, 0.4, 1.0);
glutWireCube (1.0);
glPopMatrix();```

Result: http://img101.imageshack.us/i/75891671.jpg/ - this is what I need - figure < but it must be also solid so I have changed code:

Code :
```glPushMatrix();
glTranslatef(0, 0, -70.0f);
glTranslatef (-1.0, 0.0, 0.0);
glRotatef (45, 0.0, 0.0, 1.0);
glTranslatef (1.0, 0.0, 0.0);
glPushMatrix();
glScalef(0.02, 1, 0.02);
glutSolidCube(50);
glPopMatrix();

glPushMatrix();
glTranslatef(0, 0, -70.0f);
glTranslatef (-1.0, 0.0, 0.0);
glRotatef (-45, 0.0, 0.0, 1.0);
glTranslatef (1.0, 0.0, 0.0);
glPushMatrix();
glScalef(0.02, 1, 0.02);
glutSolidCube(50);
glPopMatrix();```

but the final result is: http://img225.imageshack.us/i/57953116.jpg/
left side first cube is in one place, and left side second cube is in different place - why ? It is figure X and I want figure < like previous.

5. ## Re: how can I make solid and wire frame cube ?

What do u get if u just replace the glutWireCube to glutSolidCube in the first code like this.
Code :
```glPushMatrix();
glTranslatef(0, 0, -70.0f);
glTranslatef (-1.0, 0.0, 0.0);
glRotatef (45, 0.0, 0.0, 1.0);
glTranslatef (1.0, 0.0, 0.0);
glPushMatrix();
glScalef (2.0, 0.4, 1.0);
glutSolidCube (1.0);
glPopMatrix();

glPushMatrix();
glTranslatef(0, 0, -70.0f);
glTranslatef (-1.0, 0.0, 0.0);
glRotatef (-45, 0.0, 0.0, 1.0);
glTranslatef (1.0, 0.0, 0.0);
glPushMatrix();
glScalef (2.0, 0.4, 1.0);
glutSolidCube (1.0);
glPopMatrix();```

6. ## Re: how can I make solid and wire frame cube ?

Interesting - I have got that what I wanted - figure <, but when I have changed:
Code :
`glutSolidCube (1.0);`

to

Code :
`glutSolidCube (50.0);`

I have got figure X - what can I do ?