We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
3D Basics.... (Read 678 times)
3D Basics....
Dec 2nd, 2008, 10:35pm
 
Hi there

I am quite new to working with 3D so I was wondering if anyone has a tutorial I could follow?

I am looking to do a animation based around boxes on a grid. Each section of the grid contains a box and that box is either X pixels high, or Y pixels low.

So I am looking to understand how to draw up the grid and then arrange the boxes side by side but being able to  differ their height.

I have done this in 2D, but am completely confused by 3D. I have also tried to follow a Java 3D tutorial on the web, but I failed at the first hurdle as I can't get the relevant libraries installed. Sad

I did try the box example on this site, but I am struggling controlling its size and position.

Any help / advise would be appreciated. Just to say again, I am new to the world of 3D so have struggled with what is on this website.
Re: 3D Basics....
Reply #1 - Dec 3rd, 2008, 11:33pm
 
Don't even look at the Java 3D tutorials at this stage -- that will just confuse you.

Start by taking a simple 2D sketch with circles, square, whatever, and start adding z translations.  So maybe instead of a circle that follows your mouse in 2D:

ellipse(mouseX, mouseY, 10, 10);

...draw a circle that moves closer/further away in response to mouse movement:

pushMatrix();
translate(100, 100, mouseX);
ellipse(0, 0, 10, 10);
popMatrix();

See how translate(), which is usually used with just two arguments (x, y) can take a third (x, y, z).  Use that to place your objects in space.
Page Index Toggle Pages: 1