changeset 1165:ab8ed4d1d211 draft

get_matrix_scale
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 21 May 2011 21:32:57 +0900
parents d7637cb85bd8
children 38111db531e0
files Renderer/Engine/Makefile.def Renderer/Engine/matrix_calc.cc Renderer/Engine/matrix_calc.h TaskManager/ChangeLog
diffstat 4 files changed, 56 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.def	Mon May 09 16:29:30 2011 +0900
+++ b/Renderer/Engine/Makefile.def	Sat May 21 21:32:57 2011 +0900
@@ -5,8 +5,8 @@
 ABIBIT = 64 
 ABI = -m$(ABIBIT)
 CC      = g++
-#OPT	=  -g -DUSE_TASKARRAY -DUSE_PIPELINE -DUSE_SEGMENT 
-OPT	= -O9 -DUSE_TASKARRAY -DUSE_PIPELINE #-DUSE_SEGMENT  
+OPT	=  -g -DUSE_TASKARRAY -DUSE_PIPELINE -DUSE_SEGMENT 
+# OPT	= -O9 -DUSE_TASKARRAY -DUSE_PIPELINE #-DUSE_SEGMENT  
 
 CFLAGS  = -Wall $(ABI) $(OPT)  #  -DDEBUG
 
--- a/Renderer/Engine/matrix_calc.cc	Mon May 09 16:29:30 2011 +0900
+++ b/Renderer/Engine/matrix_calc.cc	Sat May 21 21:32:57 2011 +0900
@@ -224,6 +224,49 @@
 
 }
 
+void
+get_matrix_scale( float *matrix, float *rxyz, float *txyz, float *scale, float *stack)
+{
+  float radx,rady,radz;
+  radx = rxyz[0]*3.14/180;
+  rady = rxyz[1]*3.14/180;
+  radz = rxyz[2]*3.14/180;
+
+  float sinx = sin(radx)*scale[0];
+  float cosx = cos(radx)*scale[0];
+  float siny = sin(rady)*scale[1];
+  float cosy = cos(rady)*scale[1];
+  float sinz = sin(radz)*scale[2];
+  float cosz = cos(radz)*scale[2];
+
+  float m1[16];
+  float *m = stack? m1 : matrix;
+
+  /* View Transform */
+  m[0] = cosz*cosy+sinz*sinx*siny;
+  m[1] = sinz*cosx;
+  m[2] = -cosz*siny+sinz*sinx*cosy;
+  m[3] = 0;
+  m[4] = -sinz*cosy+cosz*sinx*siny;
+  m[5] = cosz*cosx;
+  m[6] = sinz*siny+cosz*sinx*cosy;
+  m[7] = 0;
+  m[8] = cosx*siny;
+  m[9] = -sinx;
+  m[10] = cosx*cosy;
+  m[11] = 0;
+  m[12] = txyz[0];
+  m[13] = txyz[1];
+  m[14] = txyz[2];
+  m[15] = 1;
+  
+  if(stack)
+    {
+	matrix4x4(matrix, m, stack);
+    }
+
+}
+
 void rotate_x(float *xyz, float r)
 {
   float rad = r*3.14/180;
--- a/Renderer/Engine/matrix_calc.h	Mon May 09 16:29:30 2011 +0900
+++ b/Renderer/Engine/matrix_calc.h	Sat May 21 21:32:57 2011 +0900
@@ -3,6 +3,7 @@
 
 void noMoreMemory();
 void get_matrix(float *matrix, float *rxyz, float *txyz, float *stack);
+void get_matrix_scale(float *matrix, float *rxyz, float *txyz, float *scale, float *stack);
 void rotate_x(float *xyz, float r);
 void rotate_y(float *xyz, float r);
 void rotate_z(float *xyz, float r);
--- a/TaskManager/ChangeLog	Mon May 09 16:29:30 2011 +0900
+++ b/TaskManager/ChangeLog	Sat May 21 21:32:57 2011 +0900
@@ -1,4 +1,13 @@
-20110-2-22 Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
+2011-5-21 Shinji KONO <kono@ie.u-ryukyu.ac.jp>
+
+	spu 上の bound で、ListElement を書き換えるようにすると、
+	ListElement を64bitにできる。
+
+	あとは mail の返値を EA を使って 64bit addressにすれば、Cell でも64bit で
+	動くようになるか。
+
+
+2011-2-22 Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
 
 	SPE使った場合、光源が変なバグ直したん。
 	task/CreateSpanでは normal はしっかり扱っていたが spe/CreateSpanは、そのコードがなかった。反映ミスかな。