Loading...
Logo
Processing Forum

glu.glBox??

in Programming Questions  •  2 years ago  

 

Hello all,

 

I am using a Code similar to that below for a sphere.

Now I want to have a box in the same manner.

How to do?

I am asking this because my problem is that I have a normal processing-box but it seems to be in another coordinate-system then the sphere. So I want to keep the sphere and bring the box in the sphere's coordinate-system.

Thanks!

Greetings, Chris

 

  1. void draw() {
  2.   background(0);
  3.   pgl.beginGL();
  4.   gl.glPushMatrix();
  5.   gl.glRotatef(degrees(rotateearth),0.0,0.0,1.0);
  6.   gl.glColor3f(1,1,1);
  7.   earth.enable();
  8.   earth.bind();
  9.   glu.gluSphere(mysphere, r, 40, 40);
  10.   earth.disable();
  11.   gl.glPopMatrix();
  12.   pgl.endGL();
  13.   if (rotateearth < 360) {
  14.     rotateearth = rotateearth + .0005;
  15.   }
  16.   else {

 

Replies(1)

Re: glu.glBox??

2 years ago
I don't think java GLU class has a "gluBox" method neither glBox.Have a look at it's API documentation.

I don't know if it's an answer to your question but you can use the glut class from the package "com.sun.opengl.util" and call it's method glutWireCube() or glutSolidCube(). You can have a look at GLUT class documentation.

If that don't answer your question i'm sorry i never had the time to play with such features yet.