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
modelview in P2D (Read 3348 times)
modelview in P2D
May 3rd, 2005, 10:46am
 
In the code for PGraphics.java:

I think the methods modelX() modelY() and modelZ() should call the depthError() instead of the depthErrorXYZ().

Quote:
 /**
  * Returns the model space x value for an x, y, z coordinate.
  * <P>
  * This will give you a coordinate after it has been transformed
  * by translate(), rotate(), and camera(), but not yet transformed
  * by the projection matrix. For instance, his can be useful for
  * figuring out how points in 3D space relate to the edge
  * coordinates of a shape.
  */
 public float modelX(float x, float y, float z) {
   depthErrorXYZ("modelX");
   return 0;
 }


where depthErrorXYZ():

Quote:
 protected void depthErrorXYZ(String method) {
   throw new RuntimeException(method + "(x, y, z) can only be used with " + "OPENGL or P3D, use " +                               method + "(x, y) instead.");}


Because this methods have no sense in the P2D renderer since the camera manipulations are not supported and the "sister" functions modelX(x,y) don't exist.
Re: modelview in P2D
Reply #1 - May 3rd, 2005, 5:42pm
 
good point.. thanks for the catch, i've fixed it for the next rev.
Page Index Toggle Pages: 1