RE: [GD-Consoles] transforms
Brought to you by:
vexxed72
|
From: Mick W. <mi...@ne...> - 2002-05-10 00:05:30
|
We use Matricies. A matrix implicity contains the three heading vectors
(X,Y,Z = Right, Up, At unit vectors), we then have such amusing code as
(abridged):
float dot_right_normal = Mth::DotProduct(mp_physics->m_matrix[X],normal);
float angle = acosf(dot_right_normal);
float turn_angle = angle * Script::GetFloat("Wall_Bounce_Angle_Multiplier")
* lerp; // angle away from the wall
mp_physics->m_matrix.RotateYLocal(turn_angle); // erm...
Hours of endless fun can be had with code such as this!
Angles are fine for 2d type problems.
Mick
-----Original Message-----
From: gam...@li...
[mailto:gam...@li...]On Behalf Of R
& D (GameBrains)
Sent: Thursday, May 09, 2002 4:49 PM
To: Tom Forsyth; Gam...@li...
Subject: Re: [GD-Consoles] transforms
Tom,
Thanks for your note.
> We store animations as either quaternions or as Euler angles as
appropriate,
> then convert them to matrices, and _then_ we do maths with them. Never
> attempt to do maths with angles - you'll just hurt yourself on those
> singularities. :-)
>
Excuse the follow-up question if it is naiive :-) but without the angles,
doesn't positioning code like physics become problematic? It is easy to
look at a car bouncing off a guardrail and calculate a reflected angle and
new heading vector from an angle, but how would I go about doing that with
matrices only?
Thanks,
Brett
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: ban...@so...
_______________________________________________
Gamedevlists-consoles mailing list
Gam...@li...
https://lists.sourceforge.net/lists/listinfo/gamedevlists-consoles
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU3
|