Solved

DirectX 9.0c - rotations around an axis & around a point

Posted on 2004-11-01
1,082 Views
Last Modified: 2013-12-08
  I have D3d working. I trying to make a car driving game and I have the four wheels. Their move is ok the front wheels rotation around themselfs is ok too. The problem is when a car moves and the wheels are turned a rotation around a point should occur (that point is between the back wheels i think). So what I'm trying to do is to rotate the wheels around that point.
   If I use the code to rotate around its own center I have no problem if I add the code to  rotate around a point, it'll rotate around that point correctly but won't rotate around itself. Insted it will rotate around that point, nomatter what. (the front wheels rotate around the point I use for simulate the rotation of the car when it was suposed to rotate around itself).
   The rotation is made every frame so I have their values on variables. I tried to change the point to zero after a rotation over a point but what happens is that the rotations doesn't happen that way.
   I've been searching for a solution on forums but they never work with both rotations at the same time. Can somebody help me???

when the rotation is around 0,0,0:
   scale
   rotate
   translate
   world=scale*rotate*translate
||The code works this way||

when the rotation is around a point:
   scale
   translate1 (to that point)
   rotate
   translate2 (back to where it was suposed to be)
   world=scale*translate1*rotate*translate2
||This only works when I rotate around a point

thnks for reading/helping ppl
0
Question by:Sc0rp
    2 Comments
     

    Author Comment

    by:Sc0rp
    I found the awnser by myself. I must:

       1º Scale
       2º Rotate around itself
       3º Translate to a point around wich I want to rotate
       4º Make the rotation
       5º Translate back to where it was (just use the simetric coordinates of the point around wich I want to rotate)
       6º Translate to where I want

       I think if I do something diferente or by another order it'll not work the right way. I hope that anyone that find this problem read this and resolve his problem ;).
    0
     

    Accepted Solution

    by:
    Question PAQ'd
    500 points refunded.

    CetusMOD
    Community Support Moderator
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    Best CODE lenguaje to learn 3 510
    3d letters for 3d font rendering 7 928
    scores100 challenge 3 49
    count8 challlenge 13 34
    What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
    As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
    Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    875 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now