How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX
How to rotate (*.x)file in directX How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
Go Back  Xtreme Visual Basic Talk > > > > How to rotate (*.x)file in directX


Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2004, 01:50 AM
Jeme Jeme is offline
Newcomer
 
Join Date: Mar 2004
Posts: 1
Unhappy How to rotate (*.x)file in directX


Hi...
I just wanna know some code where i can rotate an x files and can highlight an object when i pointed a mouse on that x files...
I really tension bout this code because i keep trying for a whole week n it didn't work...
I'really stuck...help me..
Reply With Quote
  #2  
Old 04-01-2004, 12:23 AM
SystemOfADown's Avatar
SystemOfADown SystemOfADown is offline
Contributor
 
Join Date: Aug 2003
Location: My Room
Posts: 607
Default

after writing this i realized i wandered into the .net forum.
my code is written for dx8 thru vb6, so i dont think it will directly help with .net or dx9. but indirectly it might help u to figure this out on your own if nobody else responds.
so i will just leave my outdated vb6 here in case you can adapt it. plus it looks cool.

well to rotate x files you just perform a matrix rotation on the object and then multiply the resulting matrix into the world matrix. like so
Code:
D3DXMatrixIdentity matTemp D3DXMatrixRotationAxis matTemp, MakeVector(0, 1, 0), RotateAngle * Rad D3DXMatrixMultiply matWorld, matWorld, matTemp
this code will rotate the x file on the y axis (0, 1, 0)
you will also mostly use (1, 0, 0) - x axis rotation and (0, 0, 1) - z axis rotation
you can also specify other axes
use this to rotate on arbitrarily defined axes
Code:
D3DXMatrixIdentity matTemp D3DXMatrixRotationY matTemp, RotateAngle * Rad D3DXMatrixMultiply matWorld, matWorld, matTemp
this will rotate the object on its y axis, but around the origin.
you can also use D3DXMatrixRotationX and D3DXMatrixRotationZ, but other than that it is rather limited. likely you will not use this method because this method will rotate objects around 0,0,0. therefore and object rotated 90 degrees from 100 units behind you (0,0,-100) will end up 100 units to your right rather than turning in place.

Definitions in code
RotateAngle is the angle to rotate - rotations are performed in Radians so it is multiplied by
Rad - a constant defined as 180/pi (i think)
matWorld-world matrix
matTemp-temporary matrix used for the rotation calculations

not sure if those defintions were necessary, but they are there just in case

Last edited by SystemOfADown; 04-01-2004 at 12:44 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DirectX Texture Tool problem Enknown DirectX 5 02-04-2004 03:45 PM
DirectX and VB6 GaMezMaker DirectX 2 12-15-2003 04:50 PM
DirectX Collisions Denaes DirectX 2 05-27-2003 07:30 AM
Have you made 3D games with DirectX? Please help! Thanks! :) hacker2002 DirectX 1 03-01-2003 09:11 PM
Obtain DirectX danavis DirectX 1 09-11-2002 12:39 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
How to rotate (*.x)file in directX How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
 
How to rotate (*.x)file in directX
How to rotate (*.x)file in directX
 
-->