Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-11-01
2
Medium Priority
?
1,092 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
Comment
Question by:Sc0rp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:Sc0rp
ID: 12478073
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:
CetusMOD earned 0 total points
ID: 12485391
Question PAQ'd
500 points refunded.

CetusMOD
Community Support Moderator
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

636 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