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.
IndexProgramming Questions & HelpSyntax Questions › Plane attached to camera
Page Index Toggle Pages: 1
Plane attached to camera (Read 1309 times)
Plane attached to camera
Jun 14th, 2006, 7:16pm
 
I suppose that mose of you know 3d programms.
I am trying to see up in Processing P3D (3d mode) a plan attached to camera.
So when my camera is moving around in 3d space, at least one plane is always parrallel to camera.

Any hints ? Advices from coders ?
Re: Plan attached to camera
Reply #1 - Jun 14th, 2006, 7:19pm
 
So many spellng mistakes.
I write it again :
I working with processing 3d mode and a camera. The camera is moving all around my space. How could i make an object attached to the camera ?

Thanks.
Re: Plane attached to camera
Reply #2 - Jun 14th, 2006, 11:09pm
 
If you look through: http://www.hardcorepawn.com/CoOrds/ you may well find that I've either solved your problem, or provided most of the code to solve it.
Re: Plane attached to camera
Reply #3 - Jun 14th, 2006, 11:30pm
 
This is a nice clue, I am sure i will be able to learn from it.
Thanks John G.

I am experimenting with this billiant piece of code :
http://mkv25.net/applets/brickBuilder/
You must know it.

I am trying to create some tools in the same pde, like indication of the number of bricks, heigh of the highest pile of bricks...I inserted text boxes but when i move the camera, my text fields moves because of course as they are in the same space as the grid and the other objects.

Don' t you think the best way would be to get angles and position of the camera in real time  and move/transform my tool synchro with the camera so they always face it ? But this would be very demanding for the processors....

There would be another solution to work with two different api who are talking together...but this seems a bit phony for me...it would be much more beautifull it everything would be working all together in the same applet.

Any idea and wise advises ?

Thanks
Re: Plane attached to camera
Reply #4 - Jun 15th, 2006, 11:59am
 
You can do more than one camera() call inside draw, one to draw the 3D stuff, then another to let you draw your interface.

You may however need to clear the zbufferor text may appear under the 3D stuff. Here's some outline code that may help:

Code:
void draw()
{
... camera() translate() etc etc...
... draw 3D stuff ...

camera(); //reset camera to default settings.

for(int i=0;i<((PGraphics3)g).zbuffer.length;i++)
{
((PGraphics3)g).zbuffer[i]=MAX_FLOAT;
}
... draw text etc ...
}


Or if you're using OPENGL:
Code:
import javax.media.opengl.*;

... setup etc ...

void draw()
{
... as before until the for(...);
((PGraphicsGL)g).gl.glClear(GL.GL_DEPTH_BUFFER_BIT);
... text and 2D stuff ...
}
Re: Plane attached to camera
Reply #5 - Jun 15th, 2006, 11:16pm
 
That is it I think !
Thank you John.
I will explore your ideas.
I give some news here about how it proceeds.

Best Regards.
Page Index Toggle Pages: 1