FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   project() and projXYZ
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: project() and projXYZ  (Read 655 times)
hurlbot


project() and projXYZ
« on: Jan 20th, 2003, 5:44am »

I am trying to get the screen coordinates of an object for 3d mouse following by using project(objectX, objectY, objectZ); and then using g.projX, g.projY, and g.projZ to set a tranlate for the object. But the project doesn't seem to incorporate the z dimension when calculating screen coordinates. Thanks in advance for your insight.
 
 
fry


WWW
Re: project() and projXYZ
« Reply #1 on: Jan 20th, 2003, 2:47pm »

that's because there is no z dimension for the screen's flat surface.
 
the z dimension that comes out of the computation is scaled such that it can be used to compare two z's against one another, but it's not usable wrt object space. for objects relatively close to one another, you could probably scale projZ to get a useful set of coordinates, but in general, that's different from how projection to the screen works.  
 
to get around this you might need a bit of linear algebra and to figure out how the matrices work well enough that you could get better values by calculating it yourself.
 
hurlbot


Re: project() and projXYZ
« Reply #2 on: Jan 23rd, 2003, 7:47am »

Is there any plan for matrix math functions to be built in to processing? Can you recommend any tutorials for artist types that want a more complete understanding of transformations and converting points to different coordinate systems? I'm trying to get the screen coordinates for buttons in 3d space so they can flexibly respond to mouse events. I imagine this would make a great example for the example page. Speaking of the example page, is there any way you could put a little "new" tag, like on the message board, next to the new examples so we can tell which ones were just added? Thanks
 
Pages: 1 

« Previous topic | Next topic »