?
Solved

direct 3d transform

Posted on 2002-03-09
4
Medium Priority
?
445 Views
Last Modified: 2013-12-26
Hi!
i'm working with directx 8 and i wanna create a 3d app(c++).

for each object i wanna use, i store all rotations, all scales and all translations. (in each direction (x,y,z)).
so, when i want to render a object, i call

D3DXMatrixTransformation(&matworld,NULL,&t_rotations,&t_scales,NULL,NULL,&t_translations);

and just before rendering
dxmanager->lpd3ddev->SetTransform(D3DTS_WORLD, &matworld);

it seems to work when my object is only scales and/or translated, but when i try to rotate it... the scale doesn't work anymore...

pleeeaaase heeeeeelp!!

thanks, Ralph
0
Comment
Question by:ralph78
[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
4 Comments
 
LVL 2

Accepted Solution

by:
kamarey earned 200 total points
ID: 6855124
Try this:
D3DXMatrixTransformation(&matworld,NULL,NULL,&t_scales,NULL,&t_rotations,&t_translations);

if it doesn't work use this functions to do your transformations:
D3DXMatrixRotationAxis(), D3DXMatrixScaling(), D3DXMatrixTranslation().
matrix = ms * mr * mt;
SetTransform(matrix);

If it still doesn't work place here your code.
0
 
LVL 2

Expert Comment

by:ET3D
ID: 6882654
You're using the wrong rotation parameter. I assume you want to rotate the object, in which case you should use the rotation and rotation centre parameters, not the "scaling rotation" which you're using in the code you posted.
0
 

Expert Comment

by:CleanupPing
ID: 9464551
ralph78:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

764 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