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 / Using limbs to position objects?

Author
Message
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Oct 2003 02:03
This is my theory...I want to position objects around my character, and make sure these objects move with the character (lights, for example).

Would this work...

1. Add a limb
2. position it where I want the light to be in relation to the character
3. Hide the limb
4. Use the limb positions X,Y,Z to update the position of my light.


Is this a good way to go about this, or is there easier way? I figure this is easier and less intensive than using newx/y/zvalue every cycle.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Oct 2003 02:52
It's easier, but is it really faster? The position of the limb is still calculated in the same way that you would do it manually - the details are just hidden.

Also, have you thought about using the vector/matrix commands to position your light?

I guess that this is just one of those things that you need to try
Xander
23
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 15th Oct 2003 03:33
I use this method often, just make sure you Offset the limb to the position you want your object, then hide the limb, and position the objects that you want there. There are a couple problems with this method:

I often have to create a new object (just a small plain) and add limbs to it and position and rotate this object at the other object's position and rotation. This must be done, at least with DB Pro sometimes, because when I add new limbs to loaded objects they don't update their position correctly.

This method is many times easier than trying to use math

The best of luck to you.

Xander - Bolt Software

It doesn't matter if it is confusing, as long as it works
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Oct 2003 10:49 Edited at: 15th Oct 2003 10:55
IanM: I've never used vectors, but it looks interesting stuff. Can you clarify for me how I would use them...

I have a vector for my object position
I have an "offset" vector position, which would describe my light position relative to the object (e.g 0,50,0 for a light directly above).
I add the two vectors together to get the light position.

Does this sound correct? If it is, how do I create a vector from my object position? Do I have to use Object Position X/Y/Z every cycle to reset it? I can't find any object/vector commands.

The other question is this...How would you rotate the vector in relation to the object? For example, if I want the light to always be behind the object, it must move relatigve to the object angle.

Sorry for all the questions, but this is new territory for me. Thanks in advance.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Oct 2003 15:05
Is was going to try and explain this stuff ... but I'm crap at that

Hopefully, the code will say it better than I could ... If you need help with any of it, just let me know and I'll see what I can do

Use the following keys:
up/down to move the base object
left/right to rotate around the y axis
w/s to rotate the slave objects around the x axis
a/d to rotate the slave objects around the z axis
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Oct 2003 19:30
Thanks IanM, that's what I call going the extra mile

I'll check it out tonight, see if I can decipher it.
I think this marks a major step in my DB Pro development skills - even wanting to attempt to use these commands.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Oct 2003 20:35
I'm suffering from Flu and boredom ATM ... this was an interesting distraction from daytime TV
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Oct 2003 21:40
Ian...it's a nice little demo! One problem...I just don't get it!

I'm happy with the vector bit, but as I don't know what the Matrix commands do, I don't know what you are doing with them. The help is of little help with these commands.

Any chance of a quick overview of what the Matrix commands do?

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Oct 2003 22:06
Well, as I said, I understand them, can use them, but that doesn't mean that I can explain them to someone ...

Try reading this very basic intro : http://www.gamedev.net/reference/articles/article877.asp

then check out some of the other references on Gamedev : http://www.gamedev.net/reference/list.asp?categoryid=28#159
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Oct 2003 22:20
Cheers Ian

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php

Login to post a reply

Server time is: 2026-07-26 05:21:27
Your offset time is: 2026-07-26 05:21:27