After setting 320.f to the value, it is not changed.
%d is mistaken in print. I'm very sorry for that.
Choosing scale function is wrong I'm very for that.
And It's going to work well if you modify them( at 29211004 ).
int v3dCalculation::calculation_thread_023() { vPoint* eye = nullptr; printf("v3dCalculation:: calculation_thread_023 () starts.\r\n"); eye = new vPoint(); eye->setPoint( 1000.0f, 1000.0f, -1000.0f); vPoint* U= new vPoint ( 160.0f, 0.0f, 0.0f ); vPoint* V= new vPoint ( 0, 90.0f, 0 ); screen_004.put_U ( *U ); screen_004.put_V ( *V ); vPoint* up = memorizevPoint( -10.0f, 10.0f, 0.0f ); screen_004.put_Up ( *up ); screen_004.setWidth ( 640 ); screen_004.setHeight ( 480 ); screen_004.setEye ( *eye ); screen_004.LookAt ( *(new vPoint( 0.0f, 0.0f, 0.0f )) ); screen_004.Set_HowFarFrmEye ( 320.0f ); printf("screen_004.HowFarFromEye=%f\r\n", screen_004.HowFarFromEye); screen_004.calculation_up_UV(); printf("v3dCalculation:: calculation_thread_023 () ends.\r\n"); }
void vScreen::Set_HowFarFrmEye (float howfarfrmeye) { printf("void vScreen::Set_HowFarFrmEye (float howfarfrmeye) starts.\r\n"); this->HowFarFromEye = howfarfrmeye; printf("this->HowFarFromEye=%d\r\n", this->HowFarFromEye); printf("void vScreen::Set_HowFarFrmEye (float howfarfrmeye) ends.\r\n"); }
void vScreen::calculation_up_UV () { vCalculation calc_this; vPoint howfar, harfU, harfV; printf("void vScreen::calculation_up_UV () starts.\r\n"); printf("this->eye= "); this->eye.print(); printf("lookat= "); this->lookat.print(); printf("this->HowFarFromEye=%d\r\n", this->HowFarFromEye); calc_this.subtract ( &(this->lookat), &(this->eye), &howfar ); calc_this.normal( &howfar ); printf("normal howfar= "); howfar.print(); calc_this.scale( howfar, this->HowFarFromEye ); printf("this->HowFarFromEye=%d\r\n", this->HowFarFromEye); printf("howfar= "); howfar.print(); calc_this.add( &(this->eye), &howfar, &(this->C) ); normal ( &(this->up) ) ; printf("up= "); up.print(); u = cross( howfar, up ); //right , -left calc_this.normal ( u ) ; up = cross( u, howfar ); //up v = cross( up, u ); // depth calc_this.scale( &u, this->width, &U ); calc_this.scale( &(this->up), this->height, &V ); // V means UP, v means depth direction printf("u= "); u.print(); printf("U= "); U.print(); printf("V= "); V.print(); calc_this.scale( &(u), -this->width/2.0f, &harfU ); calc_this.scale( &(this->up), -this->height/2.0f, &harfV ); calc_this.add( &(this->C), &(harfU), &(this->C) ); calc_this.add( &(this->C), &(harfV), &(this->C) ); printf("this->C= "); this->C.print(); calc_this.add( &(this->C), &(this->U), &(this->LeftTop) ); calc_this.add( &(this->C), &(this->V), &(this->RightBottom) ); printf("this->LeftTop= "); this->LeftTop.print(); printf("this->RightBottom= "); this->RightBottom.print(); printf("void vScreen::calculation_up_UV () ends.\r\n"); }
> .\winmain_001.exe
main starts.
v3dCalculation:: calculation_thread_023 () starts.
memorizevPoint starts: -10.000000 10.000000 0.000000 dummy_vPoint_index 0 dummy_vPoint_max 0
dummy_vPoint_max = 0 allocation starts.
dummy_vPoint_max = 8 allocation ends.
aNew: 0/8 dummy_vPoint=0055AC90
void vScreen::Set_HowFarFrmEye (float howfarfrmeye) starts.
this->HowFarFromEye=0
void vScreen::Set_HowFarFrmEye (float howfarfrmeye) ends.
screen_004.HowFarFromEye=320.000000
void vScreen::calculation_up_UV () starts.
this->eye= p|00433940|( 1000.000000, 1000.000000, -1000.000000)
lookat= p|00433958|( 0.000000, 0.000000, 0.000000)
this->HowFarFromEye=0
int vCalculation::subtract starts p1|00433958| p2|00433940| p3|0028FE30|