Project

General

Profile

« Previous | Next » 

Revision 62c869ad

Added by Leszek Koltunski over 3 years ago

Fix normals in case of MatrixEffectScale / Shear.
Fix displaying the normal vector.

View differences:

src/main/java/org/distorted/library/effect/MatrixEffectRotate.java
52 52
 *
53 53
 * @y.exclude
54 54
 */
55
  public void apply(float[] matrix, float[] uniforms, int index)
55
  public void apply(float[] matrixP, float[] matrixV, float[] uniforms, int index)
56 56
    {
57 57
    float angle = uniforms[NUM_UNIFORMS*index  ];
58 58
    float axisX = uniforms[NUM_UNIFORMS*index+1];
......
63 63
    float y = uniforms[NUM_UNIFORMS*index+CENTER_OFFSET+1];
64 64
    float z = uniforms[NUM_UNIFORMS*index+CENTER_OFFSET+2];
65 65

  
66
    Matrix.translateM(matrix, 0, x, y, z);
67
    Matrix.rotateM( matrix, 0, angle, axisX, axisY, axisZ);
68
    Matrix.translateM(matrix, 0,-x,-y,-z);
66
    Matrix.translateM(matrixP, 0, x, y, z);
67
    Matrix.rotateM   (matrixP, 0, angle, axisX, axisY, axisZ);
68
    Matrix.translateM(matrixP, 0,-x,-y,-z);
69

  
70
    Matrix.translateM(matrixV, 0, x, y, z);
71
    Matrix.rotateM   (matrixV, 0, angle, axisX, axisY, axisZ);
72
    Matrix.translateM(matrixV, 0,-x,-y,-z);
69 73
    }
70 74

  
71 75
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff