Skip to main content
GameDev.net gamedev.net
🔒 Locked

Normalized 3D vector

Started by OB1st May 26, 2002 at 8:07 AM 4 replies 650+ views
Original Post
OB1st
OB1st
In plain English, can someone elaborate on the term "Normalized version of 3D Vector" Thanks If love is illusion and hate is real, I would rather be crazy
I would love going home to M7, but I can't detect black holes.
ACAC
ACAC
And its usefull because it reduces compliated calculations DX ( or OGL ) has to make, thats why alot of DX functions want you to pass a normalised vector,

which is easier, working with a vector that has a magnitude of
1.54238
or
1?

OB1st
OB1st
Well explained. Thanks

Please do not get disencouraged, the question looks long but this is due to being well explained and specific. It will be simple for those who started before me.

In the tutorials acompany the DX8 SDK. the "light/tutorial#4", the programer used the following statment in the procedure named "Setuplights"

D3DXVECTOR vecDir
.......
vecDir = D3DXVECTOR3(cosf(timeGetTime()/350.0f),
1.0f,
sinf(timeGetTime()/350.0f) );

D3DXVec3Normalize( (D3DXVECTOR3*)&light.Direction, &vecDir );

Why he is using the "timeGetTime()" function,to assign a value to the x, and z components of the vector, and why he is dividing by 350. Does he wants the light direction to be time dependant and take 350 seconds cycles(this is my guess).

in the D3DXVec3Normalize step, Is he casting the direction component of the light structure to a pointer to D3DXVECTOR. what is he actualy trying to acomplish in this step?

My best regards to the best forum

If love is illusion and hate is real, I would rather be crazy
I would love going home to M7, but I can't detect black holes.
OB1st
OB1st
God bless you

Thanks



If love is illusion and hate is real, I would rather be crazy
I would love going home to M7, but I can't detect black holes.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.