MCPcopy Index your code
hub / github.com/benfry/processing4 / modelZ

Method modelZ

core/src/processing/opengl/PGraphicsOpenGL.java:4730–4747  ·  view source on GitHub ↗
(float x, float y, float z)

Source from the content-addressed store, hash-verified

4728
4729
4730 @Override
4731 public float modelZ(float x, float y, float z) {
4732 float ax =
4733 modelview.m00*x + modelview.m01*y + modelview.m02*z + modelview.m03;
4734 float ay =
4735 modelview.m10*x + modelview.m11*y + modelview.m12*z + modelview.m13;
4736 float az =
4737 modelview.m20*x + modelview.m21*y + modelview.m22*z + modelview.m23;
4738 float aw =
4739 modelview.m30*x + modelview.m31*y + modelview.m32*z + modelview.m33;
4740
4741 float oz =
4742 cameraInv.m20*ax + cameraInv.m21*ay + cameraInv.m22*az + cameraInv.m23*aw;
4743 float ow =
4744 cameraInv.m30*ax + cameraInv.m31*ay + cameraInv.m32*az + cameraInv.m33*aw;
4745
4746 return nonZero(ow) ? oz / ow : oz;
4747 }
4748
4749 //////////////////////////////////////////////////////////////
4750

Callers

nothing calls this directly

Calls 1

nonZeroMethod · 0.95

Tested by

no test coverage detected