?
Solved

world transform setup

Posted on 2006-05-05
2
Medium Priority
?
414 Views
Last Modified: 2013-12-08
Using C# and directX1.1, I have a mesh object ( an aircraft) and another (tarmac). I am trying to move the aircraft around the tarmac. Taxi it.

I have done the trig to determine turning radius & have incorporated it to code. I  have variables, a float called steering angle, which determines a vector3 called turningRadius ( a point that aircraft object pivots around). For now, I just want the aircraft to move 1/10th of a radian around the circle centerd on the turningRadius with a radius of the distance from aircraft to vector3  turningRadius. I’ve added code to increment or decrement the steering angle and I want to be able to drive the aircraft in varying radius circles.

My question is how to set up my world transform at aircraft render time.

I’ve thought;
AcftMatrix = acftMatrix * Matrix.Translation(turningRadius,0,50.246f)  * // the acft’s axles are 50.246 units from mesh center
Matrix.RorationY(.1f) *
Matrix.Translation(-turningRadius,0,-50.246);  // slew back to the new position
MyDevice.Transform.World = acftMatrix;

My thought was that I would start at my current acft position, translate to the turning radius, rotate the world, then translate back to the new position and draw the acft.

Am I on the right track here? It does screwy things and I wonder if I need to pursue this or my trig (which appears correct at this time).

Thanks,
Steve
0
Comment
Question by:OutsideTheBox
2 Comments
 
LVL 3

Author Comment

by:OutsideTheBox
ID: 16626833
Well, first of all, let me say thank you all for not responding. Actually I'm not being sarcastic. I was looking for a quick answer and if someone would have answered, they probably would have done much footwork for me that I needed to do to gain the experience. I feel like I just graduated matrix math school in the last 3 days. After about 12 hours of work, I got it to work properly.

For the sake of some person doing a future search on EE, I'll briefly explain the solution I found. If anyone could offer a more elegant approach, I'm all ears.

I use two matrix, Matrix acftMatrix; Matrix turningRadius;
Between each frame to move the aircraft around the turning radius matrix, I use:
                acftMatrix = acftMatrix *
            Matrix.Translation(-TrMatrix.M41, 0, -TrMatrix.M43) *
            Matrix.RotationY(DeltaHeading)*  
                Matrix.Translation(TrMatrix.M41, 0, TrMatrix.M43);
                myDevice.Transform.World = acftMatrix;
                SetHeading(DeltaHeading);  //Updates float Heading

and to change the point that the aircraft is pivioting around:

            TrMatrix = TrMatrix *
            Matrix.Translation(-acftMatrix.M41, 0, -acftMatrix.M43) *  
            Matrix.RotationY(-Heading) *
            Matrix.Translation(deltaTurningRadius, 0, 0) *
            Matrix.RotationY(Heading)*
            Matrix.Translation(acftMatrix.M41, 0, acftMatrix.M43);


The method to update TrMatrix is only called when the steering angle is changed, not each frame.

Steve



0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16626900
Closed, 125 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question