Actually I just ordered that book from amazon yesterday :P
I currently lean the correct way no matter which way I am looking using
VectorMA using the Right Vector. (Which I believe is the cross product you
are referring too)? In the code I have
VectorMA( player->GetViewOffset(), (flPeekSeconds / 0.10f) , vRight,
vDest ); (leans right)
player->SetEyeOffset( vDest );

This will allow me to lean the correct way no matter what way I am facing.

Problem is when I am already leaning then turn, that is when the direction
becomes a problem..

At any rate, thank you both.

r00t 3:16
CQC Gaming
www.cqc-gaming.com


----- Original Message ----- From: "jeff broome" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Friday, January 21, 2005 8:30 PM Subject: Re: [hlcoders] Re: Peeking


On Fri, 21 Jan 2005 19:08:13 -0600, Justin Harvey <[EMAIL PROTECTED]>
wrote:
You should pick up a book on basic 3D math, like '3D Math Primer' or the
like.


Yes. 3D math is good. You want to create an offset vector that is constantly lerping (use google.com to find "lerp") between the original eye position and the final offset location. This vector will be the "right" vector (cross product of UP and FORWARD) and will be positive going to your right and negative going to your left. You want to constantly be calculating the offset vector (lerping it) as the player moves around (you don't want to precalculate the end position and gradually move from start to end since the end position will be incorrect when the player moves during this transition). You might also want to use slerp instead of lerp if you want the eye position to follow a curved path (instead of a straight line).

If you don't know what "lerp", "slerp", or "cross product" is, you
should buy a good 3D math book like Justin recommended, read it, then
come back and write your leaning code.

Jeffrey "botman" Broome

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders





_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Reply via email to