Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Calculate direction
Topic Started: Dec 5 2007, 03:28 PM (300 Views)
Mauro
DirectX - WinAPI Programmer
[ *  *  *  * ]
Hi, i want a point_direction but for the Z axis

for example i have 2 cube, one at z=10 and the second at z=20 i want set the rotx of cube one to facing the second cube... sorry for the english thx :(

how i can make it?

Another question:

How make md2 animations?
Programming c++ and directx
Offline Profile Quote Post Goto Top
 
MysteriXYZ
Member Avatar
Master Matrix Masher
[ *  *  *  *  *  * ]
If the first cube has coordinates (X1,Y1,Z1) and the 2nd has coordinates (X2,Y2,Z2), then the orientation of the 1st cube would be given by:
Code:
 
rotx=90+point_direction(0,0,point_distance(X1,Y1,X2,Y2),Z2-Z1);
roty=90+point_direction(X1,Y1,X2,Y2);

You might have to remove the "90+" for rotx and/or roty, depending on how you want the cube to face the other one.

Let me know if it works.
U3D is like candy; after extensive consumption, it's Best to brush.
Offline Profile Quote Post Goto Top
 
Mauro
DirectX - WinAPI Programmer
[ *  *  *  * ]
yeah very thx!!! :D
Programming c++ and directx
Offline Profile Quote Post Goto Top
 
zelda4evr
Member Avatar
Forum God
[ *  *  *  *  *  * ]
you can make md2 animation in some modelling programs like milkshape3d or misfit modeller.

Posted Image
Offline Profile Quote Post Goto Top
 
Mauro
DirectX - WinAPI Programmer
[ *  *  *  * ]
YEAH! THX TO ALL! it work!

P.S I find also the VertexTweening() function, very usefull!! :D
Programming c++ and directx
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply