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.

DarkBASIC Professional Discussion / lock object and actual object position:

Author
Message
OzBot
23
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Sweden
Posted: 14th Apr 2003 23:53
Can anyone tell me if there is a way to update an objects position when using the Lock object command.
Locking an object will fix that object to the screen as it should.
However when I wish to position other objects to the object that is locked, (Gun) they get fixed to the last position the object was positioned at i.e before the lock object command.

I know I can get around the problem by not using lock object, i.e rotating and moving the object based on input, but if there is a way to update the locked objects postion I would prefer to do this.

Cheers in advance...
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 15th Apr 2003 03:15
make an invisible cube.

place at camera location always


make a mesh

make a limb from that mesh


glue things to this limb

see source button for an example

solo
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Israel
Posted: 15th Apr 2003 03:16
As far as i know, The locked object cannot be update while its been locked. thats why it called 'locked'...

Look at my snippet:
http://www.darkbasicpro.com/apollo/view.php?t=8686&b=1

it immitates locking object to the screen center(only the center).
modify DISTANCE to your needs. I should have rotate the 'locled object' face to the camera when the camera rotates, but i didn't

you didn't describe what you intent to do with those 'other objects'.
if you want to attach them staticly to your gun , you can lock them to the screen too, no matter where their absolute world's coordinates.
if you want them to be dynamicly handled, that snippet could give some help.

I'm working on a new snippet that enable to 'lock object' to a any SCREEN POSITION X() , SCREEN POSITION Y() even beyond the screen limits, so if you get no solution, that will probably solve it.

[solo]

solo
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Israel
Posted: 15th Apr 2003 03:35
indi, very nice example.
cheers

[solo]

indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
OzBot
23
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Sweden
Posted: 15th Apr 2003 11:48
Cheers guys,
I'll give it a bash..
OzBot
23
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Sweden
Posted: 15th Apr 2003 21:54
Unfortunately, the same result is happening, when I glue a rocket to the limb, it is positioned correctly but when I set it to move, it reverts to its original position as I Unglue the object.

What i am trying to do is fire rockets from a rocket launcher, and I I don't want to it to fire from the camera position, but right of the camera position (from the weapon). I don't want the weapon to be in the center.

All the tutorials shoot from the center of the camera, which I reckon is it is the easiest method.

So far this is my first problem I have encountered and it's bugging me.

A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
OzBot
23
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Sweden
Posted: 15th Apr 2003 22:01
Right solo, I just had a look at your code snippet and it looks more like what I am trying to acheive, so I will give it a whirl...
cheers...

A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
OzBot
23
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Sweden
Posted: 15th Apr 2003 23:31
nope, it moves the gun round in circles around the center of he camera.

hmmm..

A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
solo
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Israel
Posted: 16th Apr 2003 00:24
well, my code is set to position an object at the screen center,
so modification using math must be added.
is your camera, by chance, been rotated on the Z axe? because
that snipped doesn't support that kind of rotation.

Just to make things clear,
do you want to position an object in front of the camera, not necessarily in the center, then move it not relatively to camera
(that meanwhile may changed position/rotation)?

OzBot
23
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Sweden
Posted: 17th Apr 2003 12:06
Well blow me, I just thought of the most simple way to resolve my problem.

what i have to do is model my weapon slighty to the right of center (+x) in modelling software then just position it at all times at the camera position and set to camera orientation it also has the benifit that it will be easy to make the weapon sway a little bit when running, jumping etc.. Cool

Old aunts used to come up to me at weddings, poking me in the ribs and cackling, telling me, "You're next." They stopped after I started
doing the same thing to them at funerals.
solo
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Israel
Posted: 17th Apr 2003 14:34
I think that your solution is locking the camera to the object,
and not the object to the camera.
if i get you right, the camera is oriented to that object,
meaning you can't orient it to any other objects in your scene.
That way, you limit the camera options, and maybe its not the best solution.

[solo]

Login to post a reply

Server time is: 2026-07-11 02:35:10
Your offset time is: 2026-07-11 02:35:10