changeset 1303:0229c8ce0327 draft

minor change
author Yutaka_Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
date Tue, 13 Dec 2011 19:00:53 +0900
parents ab9b7d21b32b
children b606adda63fe
files Renderer/Engine/task/CreatePolygonFromSceneGraph.cc
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/task/CreatePolygonFromSceneGraph.cc	Sat Dec 10 17:53:32 2011 +0900
+++ b/Renderer/Engine/task/CreatePolygonFromSceneGraph.cc	Tue Dec 13 19:00:53 2011 +0900
@@ -70,15 +70,19 @@
 
     //pp, matrix, を受け取る
     PolygonPackPtr in_pp      = (PolygonPackPtr)smanager->get_input(rbuf, 0);
-    float *matrix             = (float*)smanager->get_input(rbuf, 1);
+    // w = world, v = view, p = perspective
+    float *wvp_matrix         = (float*)smanager->get_input(rbuf, 1);
     float *m_screen           = (float*)smanager->get_input(rbuf, 2);
 
     float normal_matrix[16]; 
   
-    for (int i = 0; i<16; i++) normal_matrix[i]=matrix[i];
-    normal_matrix[4*0+3]=normal_matrix[4*1+3]=normal_matrix[4*2+3]=0;
-    normal_matrix[4*3]=normal_matrix[4*3+1]=normal_matrix[4*3+2]=0;
-    normal_matrix[4*3+3]=1;
+    for (int i = 0; i<16; i++) normal_matrix[i] = wvp_matrix[i];
+    normal_matrix[4*0+3] = normal_matrix[4*1+3] = normal_matrix[4*2+3] = 0;
+    normal_matrix[4*3] = normal_matrix[4*3+1] = normal_matrix[4*3+2] = 0;
+    normal_matrix[4*3+3] = 1;
+
+    float matrix[16];
+    matrix4x4(matrix, wvp_matrix, m_screen);
 
     texture_list *tritexinfo  = (texture_list*)smanager->get_input(rbuf, 3);
     
@@ -116,10 +120,6 @@
       ApplyMatrix(xyz2, matrix);
       ApplyMatrix(xyz3, matrix);
 
-      ApplyMatrix(xyz1, m_screen);
-      ApplyMatrix(xyz2, m_screen);
-      ApplyMatrix(xyz3, m_screen);
-
       // このif文は、視錐台カリングに変えられる. 違うやり方があるはず
       //if (xyz1[2] > 100 && xyz2[2] > 100 && xyz3[2] > 100) {