コード例 #1
0
ファイル: Vector3D.cs プロジェクト: Hurtares/KindaRenderer
 public void geraCoordCartesianas(Matriz3D matriz)
 {
     float[] resultado = matriz.multiplicaVector(new float[4] {
         this.x, this.y, this.z, this.w
     });
     this.x = resultado[0] / resultado[3];
     this.y = resultado[1] / resultado[3];
     this.z = resultado[2];// não dividimos para preservar a informação sobre Z
     this.w = 1.0f;
 }
コード例 #2
0
ファイル: Vector3D.cs プロジェクト: Hurtares/KindaRenderer
 public void geraCoordHomogeneas(Matriz3D matriz)
 {
     float[] resultado = matriz.multiplicaVector(new float[4] {
         this.x, this.y, this.z, this.w
     });
     this.x = resultado[0];
     this.y = resultado[1];
     this.z = resultado[2];
     this.w = resultado[3];
 }