Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Rotating and object from the vertex and pointing it in the 3D space

Author
Message
047
18
Years of Service
User Offline
Joined: 4th Jun 2006
Location:
Posted: 17th Jun 2006 05:51
Hi,
How can I rotate an object from one of the ends instead of the middle of the object in Dark Basic classic. The object is a sword and it's seen from 1st person view. It rotates and moves but everything is done as if the vertex of the object was in its center inteads of on one of the ends as it's supposed to be when I created the object in Anim8or.
I'm also having problems pointing the object where I want it in the 3D space. Is there a more exact way to figure out exactly what coodinates I need to use if I want an object pointing in a certain direction? The only way I have been able to point the object in the right direction is by moving it almost point by point until it looks close to where I want it to be. And any subsequent movement after that is really hard to predict. Is there a way for example to have the program start with everything (camera, object, 3d space, etc) facing at coordinates x, y, z being 0, 0, 0? Maybe something similar to the way sprites are positioned in 2d coordinates? Also even when I position the object in a certain way at the beginning of the program it always changes to a different angle or view when I move it or rotate it. Maybe it's the position of the camera but I haven't been able to figure out what the problem is yet.
Any help will be greatly appreciated.
Thanks!!!
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 17th Jun 2006 07:04
Make sure that at the beginning of you code you put
autocam off
to make sure the camera doesn't move when objects are created.

I don't know how to set an object's axis of rotation in DBP. It could probably be done with shifting it around with object memblocks, but I don't know how to use those yet. Try repositioning where your sword is located in anim8or, but I have never used anim8or so I don't know about that.

Insanity is just a state of mind
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 20th Jun 2006 01:47
a) Manually position the sword elsewhere inside your modelling program, whatever point of the object is closest to 0,0,0 is what the object will be rotated upon, so placing the bottom of the sword at 0,0,0 in the modelling app will make the bottom of the sword where the object rotates.

b) Using memblocks, but Id guess this is far too advanced for you right now, if you dont think so do some searches on Memblocks and see what you can come up with.

c) Use a dummy object, hidden so the user cant see it. Add the sword as a limb to the object, offsetting the sword so that the handle is at the same position as the dummy object. Now rotate the dummy object instead.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 20th Jun 2006 23:37
You dont even need a dummy:

Offset Limb [Obj],1,X,Y,Z

Login to post a reply

Server time is: 2024-11-26 17:23:35
Your offset time is: 2024-11-26 17:23:35