Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,698 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,367 people online right now. Registration is fast and FREE... Join Now!




How to move a 3dobject in 3dsean

 
Reply to this topicStart new topic

How to move a 3dobject in 3dsean

debjit625
post 15 Sep, 2008 - 07:42 AM
Post #1


New D.I.C Head

*
Joined: 6 Sep, 2008
Posts: 22


My Contributions


Hi i am having a problem in rotating and moving a 3d mesh in worldspace
for example i have a mesh that i am moving forward in z direction then i rotate it and now it face to x direction but now when i move it forward it moves to z direction with facing x direction ....i know i am not very clear but if someone understand please help you can explain it in C# or C++
as you like and also i am programing this using DirectXSDK


Please help...Help...
User is offlineProfile CardPM

Go to the top of the page

Tom9729
post 15 Sep, 2008 - 09:21 AM
Post #2


Debian guru

Group Icon
Joined: 30 Dec, 2007
Posts: 1,447



Thanked 10 times

Dream Kudos: 325
My Contributions


Try calculating the mesh's rotation/position before doing a transformation.
User is offlineProfile CardPM

Go to the top of the page

debjit625
post 15 Sep, 2008 - 10:33 AM
Post #3


New D.I.C Head

*
Joined: 6 Sep, 2008
Posts: 22


My Contributions


I think i am not clear with my question anyway thanks for your reply
User is offlineProfile CardPM

Go to the top of the page

WolfCoder
post 15 Sep, 2008 - 10:45 AM
Post #4


ギュウ~

Group Icon
Joined: 5 May, 2005
Posts: 3,575



Thanked 6 times

Dream Kudos: 1450
My Contributions


It's linear algebra you seem to be doing. The order in which you apply the transformation matrices is important.

Here's an example, might not be the best but it works:

First an object must be placed at the origin. Then, the object must be scaled if your objects change their size. Then, the object must be rotated so that it is oriented to how it should look in the world. Lastly, it must be translated to it's current position in world space.

Now you have the world mapped out with it's center at the origin. You must now rotate the world to match the camera's angle. Try changing the order of translating and rotating and even excluding or including points in the transformation to view their effect.
User is offlineProfile CardPM

Go to the top of the page

Tom9729
post 15 Sep, 2008 - 11:45 AM
Post #5


Debian guru

Group Icon
Joined: 30 Dec, 2007
Posts: 1,447



Thanked 10 times

Dream Kudos: 325
My Contributions


QUOTE(debjit625 @ 15 Sep, 2008 - 02:33 PM) *

I think i am not clear with my question anyway thanks for your reply

What math courses have you taken?

They pretty much cover transformations in Geometry, albeit in 2D [but adding a third dimension is cake].
User is offlineProfile CardPM

Go to the top of the page

debjit625
post 22 Sep, 2008 - 10:38 AM
Post #6


New D.I.C Head

*
Joined: 6 Sep, 2008
Posts: 22


My Contributions


Thanks guys
User is offlineProfile CardPM

Go to the top of the page

debjit625
post 23 Sep, 2008 - 12:00 AM
Post #7


New D.I.C Head

*
Joined: 6 Sep, 2008
Posts: 22


My Contributions


Thanks everybody ,i found my mistakes in my math and its solved
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 07:55AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month