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 › moving through a 3d scene
Page Index Toggle Pages: 1
moving through a 3d scene (Read 193 times)
moving through a 3d scene
Jan 7th, 2009, 8:48am
 
- Do you render all the the geometry every draw() and let the renderers (considering P3D/OPENGL) take care of
not rendering stuff that isn't visible?

- Technically, if you have 3 rooms, do you just render the entire area,
and then camera() your way through it?  What's wrong with just translate()
to move through the world?

I promise I'm actually trying to learn this stuff; it's just a wide enough
topic area that I keep wondering what the "best practices" method is.

Thanks in advance for any tips/pointers.
Re: moving through a 3d scene
Reply #1 - Jan 7th, 2009, 9:27am
 
I can't give you the best practice, but I'm in favor of use of a camera as opposed to moving the object itself.

Here's why: a project of mine started with using the translate() method.  It made sense to me at the time because I was handling only one object, and it was easy to code.

I kind of regretted this later because I found myself stuck with the approach.  I realized it was a mistake when I needed to create a series of labels that needed to face the user's viewpoint, and I had to keep track of the main object's rotation in order to do it, which led to a very clunky implementation.  So as the models being translated became more complicated, use of camera made more and more sense.  It works just fine now, but I had to rebuild a system just to make it behave as if the camera was moving, which isn't a very smart design.

Hope this helps, and I'd like to know others' opinions as well.
Page Index Toggle Pages: 1