/** * Apply a projection transformation to this matrix that projects onto the plane with the general plane equation * <code>y = 0</code> as if casting a shadow from a given light position/direction <code>light</code>. * <p> * Before the shadow projection is applied, the plane is transformed via the specified <code>planeTransformation</code>. * <p> * If <code>light.w</code> is <code>0.0</code> the light is being treated as a directional light; if it is <code>1.0</code> it is a point light. * <p> * If <code>M</code> is <code>this</code> matrix and <code>S</code> the shadow matrix, * then the new matrix will be <code>M * S</code>. So when transforming a * vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the * reflection will be applied first! * * @param light * the light's vector * @param planeTransform * the transformation to transform the implied plane <code>y = 0</code> before applying the projection * @return this */ public Matrix4d shadow(Vector4d light, Matrix4d planeTransform) { return shadow(light, planeTransform, this); }
/** * Apply a projection transformation to this matrix that projects onto the plane with the general plane equation * <code>y = 0</code> as if casting a shadow from a given light position/direction <code>light</code>. * <p> * Before the shadow projection is applied, the plane is transformed via the specified <code>planeTransformation</code>. * <p> * If <code>light.w</code> is <code>0.0</code> the light is being treated as a directional light; if it is <code>1.0</code> it is a point light. * <p> * If <code>M</code> is <code>this</code> matrix and <code>S</code> the shadow matrix, * then the new matrix will be <code>M * S</code>. So when transforming a * vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the * reflection will be applied first! * * @param light * the light's vector * @param planeTransform * the transformation to transform the implied plane <code>y = 0</code> before applying the projection * @return this */ public Matrix4d shadow(Vector4d light, Matrix4d planeTransform) { return shadow(light, planeTransform, this); }
/** * Apply a projection transformation to this matrix that projects onto the plane with the general plane equation * <code>y = 0</code> as if casting a shadow from a given light position/direction <code>(lightX, lightY, lightZ, lightW)</code>. * <p> * Before the shadow projection is applied, the plane is transformed via the specified <code>planeTransformation</code>. * <p> * If <code>lightW</code> is <code>0.0</code> the light is being treated as a directional light; if it is <code>1.0</code> it is a point light. * <p> * If <code>M</code> is <code>this</code> matrix and <code>S</code> the shadow matrix, * then the new matrix will be <code>M * S</code>. So when transforming a * vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the * reflection will be applied first! * * @param lightX * the x-component of the light vector * @param lightY * the y-component of the light vector * @param lightZ * the z-component of the light vector * @param lightW * the w-component of the light vector * @param planeTransform * the transformation to transform the implied plane <code>y = 0</code> before applying the projection * @return this */ public Matrix4d shadow(double lightX, double lightY, double lightZ, double lightW, Matrix4dc planeTransform) { return shadow(lightX, lightY, lightZ, lightW, planeTransform, this); }
/** * Apply a projection transformation to this matrix that projects onto the plane with the general plane equation * <code>y = 0</code> as if casting a shadow from a given light position/direction <code>(lightX, lightY, lightZ, lightW)</code>. * <p> * Before the shadow projection is applied, the plane is transformed via the specified <code>planeTransformation</code>. * <p> * If <code>lightW</code> is <code>0.0</code> the light is being treated as a directional light; if it is <code>1.0</code> it is a point light. * <p> * If <code>M</code> is <code>this</code> matrix and <code>S</code> the shadow matrix, * then the new matrix will be <code>M * S</code>. So when transforming a * vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the * reflection will be applied first! * * @param lightX * the x-component of the light vector * @param lightY * the y-component of the light vector * @param lightZ * the z-component of the light vector * @param lightW * the w-component of the light vector * @param planeTransform * the transformation to transform the implied plane <code>y = 0</code> before applying the projection * @return this */ public Matrix4d shadow(double lightX, double lightY, double lightZ, double lightW, Matrix4dc planeTransform) { return shadow(lightX, lightY, lightZ, lightW, planeTransform, this); }
return shadow(lightX, lightY, lightZ, lightW, a, b, c, d, this);
return shadow(lightX, lightY, lightZ, lightW, a, b, c, d, this);
public Matrix4d shadow(Vector4dc light, double a, double b, double c, double d, Matrix4d dest) { return shadow(light.x(), light.y(), light.z(), light.w(), a, b, c, d, dest); }
public Matrix4d shadow(Vector4dc light, double a, double b, double c, double d, Matrix4d dest) { return shadow(light.x(), light.y(), light.z(), light.w(), a, b, c, d, dest); }
/** * Apply a projection transformation to this matrix that projects onto the plane specified via the general plane equation * <code>x*a + y*b + z*c + d = 0</code> as if casting a shadow from a given light position/direction <code>light</code>. * <p> * If <code>light.w</code> is <code>0.0</code> the light is being treated as a directional light; if it is <code>1.0</code> it is a point light. * <p> * If <code>M</code> is <code>this</code> matrix and <code>S</code> the shadow matrix, * then the new matrix will be <code>M * S</code>. So when transforming a * vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the * reflection will be applied first! * <p> * Reference: <a href="ftp://ftp.sgi.com/opengl/contrib/blythe/advanced99/notes/node192.html">ftp.sgi.com</a> * * @param light * the light's vector * @param a * the x factor in the plane equation * @param b * the y factor in the plane equation * @param c * the z factor in the plane equation * @param d * the constant in the plane equation * @return this */ public Matrix4d shadow(Vector4dc light, double a, double b, double c, double d) { return shadow(light.x(), light.y(), light.z(), light.w(), a, b, c, d, this); }
public Matrix4d shadow(double lightX, double lightY, double lightZ, double lightW, Matrix4dc planeTransform, Matrix4d dest) { // compute plane equation by transforming (y = 0) double a = planeTransform.m10(); double b = planeTransform.m11(); double c = planeTransform.m12(); double d = -a * planeTransform.m30() - b * planeTransform.m31() - c * planeTransform.m32(); return shadow(lightX, lightY, lightZ, lightW, a, b, c, d, dest); }
/** * Apply a projection transformation to this matrix that projects onto the plane specified via the general plane equation * <code>x*a + y*b + z*c + d = 0</code> as if casting a shadow from a given light position/direction <code>light</code>. * <p> * If <code>light.w</code> is <code>0.0</code> the light is being treated as a directional light; if it is <code>1.0</code> it is a point light. * <p> * If <code>M</code> is <code>this</code> matrix and <code>S</code> the shadow matrix, * then the new matrix will be <code>M * S</code>. So when transforming a * vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the * reflection will be applied first! * <p> * Reference: <a href="ftp://ftp.sgi.com/opengl/contrib/blythe/advanced99/notes/node192.html">ftp.sgi.com</a> * * @param light * the light's vector * @param a * the x factor in the plane equation * @param b * the y factor in the plane equation * @param c * the z factor in the plane equation * @param d * the constant in the plane equation * @return this */ public Matrix4d shadow(Vector4dc light, double a, double b, double c, double d) { return shadow(light.x(), light.y(), light.z(), light.w(), a, b, c, d, this); }
public Matrix4d shadow(double lightX, double lightY, double lightZ, double lightW, Matrix4dc planeTransform, Matrix4d dest) { // compute plane equation by transforming (y = 0) double a = planeTransform.m10(); double b = planeTransform.m11(); double c = planeTransform.m12(); double d = -a * planeTransform.m30() - b * planeTransform.m31() - c * planeTransform.m32(); return shadow(lightX, lightY, lightZ, lightW, a, b, c, d, dest); }
public Matrix4d shadow(Vector4dc light, Matrix4dc planeTransform, Matrix4d dest) { // compute plane equation by transforming (y = 0) double a = planeTransform.m10(); double b = planeTransform.m11(); double c = planeTransform.m12(); double d = -a * planeTransform.m30() - b * planeTransform.m31() - c * planeTransform.m32(); return shadow(light.x(), light.y(), light.z(), light.w(), a, b, c, d, dest); }
public Matrix4d shadow(Vector4dc light, Matrix4dc planeTransform, Matrix4d dest) { // compute plane equation by transforming (y = 0) double a = planeTransform.m10(); double b = planeTransform.m11(); double c = planeTransform.m12(); double d = -a * planeTransform.m30() - b * planeTransform.m31() - c * planeTransform.m32(); return shadow(light.x(), light.y(), light.z(), light.w(), a, b, c, d, dest); }