Lines Matching refs:PLANE
42 * Compute coefficients of a plane using the X,Y coords of the v0, v1, v2
44 * A point (x,y,z) lies on plane iff a*x+b*y+c*z+d = 0.
48 GLfloat z0, GLfloat z1, GLfloat z2, GLfloat plane[4])
58 /* Crossproduct "(a,b,c):= dv1 x dv2" is orthogonal to plane. */
62 /* Point on the plane = "r*(a,b,c) + w", with fixed "r" depending
63 on the distance of plane from origin and arbitrary "w" parallel
64 to the plane. */
69 plane[0] = a;
70 plane[1] = b;
71 plane[2] = c;
72 plane[3] = d;
77 * Compute coefficients of a plane with a constant Z value.
80 constant_plane(GLfloat value, GLfloat plane[4])
82 plane[0] = 0.0;
83 plane[1] = 0.0;
84 plane[2] = -1.0;
85 plane[3] = value;
88 #define CONSTANT_PLANE(VALUE, PLANE) \
90 PLANE[0] = 0.0F; \
91 PLANE[1] = 0.0F; \
92 PLANE[2] = -1.0F; \
93 PLANE[3] = VALUE; \
99 * Solve plane equation for Z at (X,Y).
102 solve_plane(GLfloat x, GLfloat y, const GLfloat plane[4])
104 assert(plane[2] != 0.0F);
105 return (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
109 #define SOLVE_PLANE(X, Y, PLANE) \
110 ((PLANE[3] + PLANE[0] * (X) + PLANE[1] * (Y)) / -PLANE[2])
114 * Solve plane and return clamped GLchan value.
117 solve_plane_chan(GLfloat x, GLfloat y, const GLfloat plane[4])
119 const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
133 plane_dx(const GLfloat plane[4])
135 return -plane[0] / plane[2];
139 plane_dy(const GLfloat plane[4])
141 return -plane[1] / plane[2];