Mercurial > hg > old > magoroku_racing.bad
changeset 136:157ac1fa45c1
move_car_2
author | Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 21 Jul 2011 18:22:20 +0900 |
parents | 1a92b58b5d01 |
children | 5742d4f648cf |
files | gSprite.cc schedule.cc test_vector.cc_original |
diffstat | 3 files changed, 5 insertions(+), 193 deletions(-) [+] |
line wrap: on
line diff
--- a/gSprite.cc Thu Jul 21 17:25:00 2011 +0900 +++ b/gSprite.cc Thu Jul 21 18:22:20 2011 +0900 @@ -129,7 +129,8 @@ void set_cameraMan( void ) { // window_posの略 - FVECTOR wp = {310,150, -800, 1}; + //FVECTOR wp = {310,150, -800, 1}; + FVECTOR wp = {310 ,400 , 500, 1}; for( int i = 0; i < 4; i ++ ){ root->xyz[i] = cameraMan_pos[i] + wp[i]; @@ -211,7 +212,7 @@ object->xyz[1] += y+m->my; // object->xyz[2] += zorder * 0.01; - */ + */ object->xyz[0] = x; object->xyz[1] = y;
--- a/schedule.cc Thu Jul 21 17:25:00 2011 +0900 +++ b/schedule.cc Thu Jul 21 18:22:20 2011 +0900 @@ -382,8 +382,8 @@ { printf("sche_game_main()\n"); - FVECTOR cPos = { game->jiki->location[0],game->jiki->location[1],game->jiki->location[2] ,0 }; - FVECTOR a={0,0,0,0}; + FVECTOR cPos = { game->jiki->location[0],game->jiki->location[1], -game->jiki->location[2] ,0 }; + FVECTOR a={180,0,0,0}; /** begin: dispaly RAP TIME **/ if(RUNNIG==0){
--- a/test_vector.cc_original Thu Jul 21 17:25:00 2011 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ -#include <stdio.h> -#include "ps2util.h" -#include "libps2.h" - -void init_FVECTOR(FVECTOR v, float num); -void init_FMATRIX(FMATRIX m, float num); -void output_FVECTOR(FVECTOR v); -void output_FMATRIX(FMATRIX m); -void all_init(FVECTOR v0, FVECTOR v1, FMATRIX m0, FMATRIX m1, float num); - - -/* - ps2util.c にある、vector 計算のテスト用処理です。 -*/ - -int main(){ - - FVECTOR resultV; - FMATRIX resultM; - float resultf; - - FVECTOR v0,v1; - FMATRIX m0,m1; - - float f0 = 0.5; - float num = 0.1; - - int i,j; - int lim1 = 4; - - //v0,v1,m0,m1 を初期化 - all_init(v0, v1, m0, m1, num); - - printf("v0\n"); - output_FVECTOR(v0); - - printf("v1\n"); - output_FVECTOR(v1); - - printf("m0\n"); - output_FMATRIX(m0); - - printf("m1\n"); - output_FMATRIX(m1); - - printf("\n"); - printf("\n"); - - - - - /*-----------ps2util.c test----------*/ - - ps2_vu0_copy_vector(v0, v1); - printf("ps2_vu0_copy_vector(v0, v1)\n"); - output_FVECTOR(v0); - output_FVECTOR(v1); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - ps2_vu0_unit_matrix(m0); - printf("ps2_vu0_unit_matrix(m0)\n"); - output_FMATRIX(m0); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - ps2_vu0_rot_matrix_y(resultM, m0, f0); - printf("ps2_vu0_rot_matrix_y(resultM, m0, f0)\n"); - output_FMATRIX(resultM); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - ps2_vu0_apply_matrix(resultV, m0, v0); - printf("ps2_vu0_apply_matrix(resultV, m0, v0)\n"); - output_FVECTOR(resultV); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - ps2_vu0_scale_vector(resultV, v0, f0); - printf("ps2_vu0_sacle_vector(resultV, v0, f0)\n"); - output_FVECTOR(resultV); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - ps2_vu0_add_vector(resultV, v0, v1); - printf("ps2_vu0_add_vector(resultV, v0, v1)\n"); - output_FVECTOR(resultV); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - ps2_vu0_outer_product(resultV, v0, v1); - printf("ps2_vu0_outer_product(resultV, v0, v1)\n"); - output_FVECTOR(resultV); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - resultf = ps2_vu0_inner_product(v0, v1); - printf("ps2_vu0_inner_product(v0, v1)\n"); - printf("resultf = %10f\n",resultf); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - ps2_vu0_mul_matrix(resultM, m0, m1); - printf("ps2_vu0_mul_matrix(resultM, m0, m1)\n"); - output_FMATRIX(resultM); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - ps2_vu0_copy_matrix(m0, m1); - printf("ps2_vu0_copy_matrix(m0, m1)\n"); - output_FMATRIX(m0); - output_FMATRIX(m0); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - ps2_vu0_sub_vector(resultV, v0, v1); - printf("ps2_vu0_sub_vector(resultV, v0, v1)\n"); - output_FVECTOR(resultV); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - ps2_vu0_normalize(resultV, v0); - printf("ps2_vu0_normalize(result, v0)\n"); - output_FVECTOR(resultV); - printf("\n"); - all_init(v0, v1, m0, m1, num); - - -} - - - -//使用する値の初期化 FVECTOR -void init_FVECTOR(FVECTOR v, float num){ - int i; - int lim1=4; - for ( i=0; i<lim1; i++ ) { - v[i] = num + ( (float)i * num * 0.3 ) ; - } - v[3] = 1; -} - -//使用する値の初期化 FMATRIX -void init_FMATRIX(FMATRIX m, float num){ - int i,j; - int lim1=4; - for ( i=0; i<lim1; i++ ) { - for ( j=0; j<lim1; j++ ) { - m[i][j] = ( num * (float)j ) + ( (float)i * num*4.0 ) ; - } - } - m[0][3] = m[1][3] = m[2][3] = 0; - - m[3][0] = m[3][1] = m[3][2] = 0; - m[3][3] = 1; -} - -//--------出力--------- -void output_FVECTOR(FVECTOR v){ - int i; - int lim1 = 4; - for ( i=0; i<lim1; i++ ) { - printf("%10f ",v[i]); - } - printf("\n\n"); -} - -//--------出力--------- -void output_FMATRIX(FMATRIX m){ - int i,j; - int lim1 = 4; - for ( i=0; i<lim1; i++ ) { - for ( j=0; j<lim1; j++ ) { - printf("%10f",m[i][j]); - } - printf("\n"); - } - printf("\n"); -} - - - -//全部を初期値に戻す。 -void all_init(FVECTOR v0, FVECTOR v1, FMATRIX m0, FMATRIX m1, float num){ - init_FVECTOR(v0, num); - init_FVECTOR(v1, num*2); - init_FMATRIX(m0, num); - init_FMATRIX(m1, num*2); -}