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 / Pointing Limb at object problem. Works until parent object angle changes.

Author
Message
Straxus
16
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 31st Mar 2011 02:31 Edited at: 31st Mar 2011 04:58
Last two days I have done some board searching. Trying to find a way to point the limb at object without having to buy EZ Rotate. (In between jobs right now, otherwise I would happily buy it.)
The only code snippet I found required EZ Rotate.
Did find a suggestion in a post that I tried.
In the post it mentioned having an object at same location as limb and use point object at target, then use the object's angles for the rotate limb command. This works fine until you adjust the parent object's angles.
I tried to adjust the rotation of the limb to compensate for the attached object's angles with no success.
The code and media is in attachement.
EDIT
Right after posting this I was looking up something completely unrelated and found the answer I needed... (always seems to work that way.)
Could a moderator or admin delete this thread?
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 31st Mar 2011 18:41
Better still could you tell us where you found the answer first or what it is? Someone else might save themself a lot of hard searching that way (and you'll earn some good karma)

Actually I'd like to use this for getting my character to look at objects in a current WIP...

Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 31st Mar 2011 21:06
An other thing that almost everytime seems to happen is that the thread opener just goes away saying "found it, bye!"

The forum is FILLED, with this crap!!! If you come here for help, then don't be so lazy to go away without explaining how you solved the problem!

----

Anyways, for pointing a limb at anything i usually use a 'dummy limb', which gives me a position where the pointing object would be. Then, i position the real pointing object at those coordinates, and point it at the thing i want. I don't see a single reason why there is no built in 'point limb' command, but that workaround solves it.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 31st Mar 2011 21:22
I use the solution he just mentined....to position other object in limb position x,y,z, point this object where I want, and finally update limb angles with object x,y,z angles.

Cheers.

I'm not a grumpy grandpa
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 1st Apr 2011 00:42
yes straxus, please post the answer?

Straxus
16
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 1st Apr 2011 03:57 Edited at: 1st Apr 2011 08:25
First I found this thread and learned of EZ Rotate Basic. (Was pleased to learn of a free basic version.)
http://forum.thegamecreators.com/?m=forum_view&t=183387&b=1
Then went back to the Code Snippet by Brendy boy
http://forum.thegamecreators.com/?m=forum_view&t=143263&b=6
Then after taking a closer look realized that the Quaternion and Euler in the code were custom types and that I most likely didn't need the EZ Rotate in the first place...
So it was a case of error exists between keyboard and chair. Doh!
(saw Quaternion and Euler used so much in code in my searches of the forum, that required EZ rotate I assumed the code snippet required it.)
Anyway the beautiful code by Brendy Boy helped stop my headache and allowed me to continue on with my project. Really wish I understood HOW the code works though hopefully in time and better math skills than I currently have. Fortunately it just works just like point object but for limbs.
Sorry about not replying right away. I checked the thread a few times after I edited it to see if anyone commented but didn't see anything. I just figured it would either be deleted or ignored.
So I appologize for that.
Hopefully the info I found can help others out as well. Also if Brendy Boy reads this, a huge thank you!
Tested it in my space game and works perfectly.
Another EDIT...
Since I am working on animated turrets, been trying to find a free program that converts 3DS models to X or DBO format. Just found this! Not sure how I missed this with all the times I searched for it on the forums:
http://forum.thegamecreators.com/?m=forum_view&t=22599&b=5
Rob K's X/3DS to DBO converter (including animations!)
http://www.robertknight.me.uk/files/darkbasic/convdbo.zip
Just one more useful thing I figured I could add with the other information.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Apr 2011 10:40
You can load 3DS into DBP and use "save object" to save as a DBO so effectively DBP is its own converter between 3DS and DBO.

The brendyboy code looks right for me thanks for posting this link.

I have a great set of rotation code somewhere that could also be used as a replacement for a lot of EZ Rotate's commands. They were posted a long time back and still work great today. I'll try to dig them out (if I still have them)...

Straxus
16
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 1st Apr 2011 21:07
Sounds great! I would definitely like to take a look at the rotation code if you find it.
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 1st Apr 2011 22:35
Quote: "Also if Brendy Boy reads this, a huge thank you!"

you're welcome, it's nice to see that my code id usefull to someone

Straxus
16
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 2nd Apr 2011 01:14
EXTREMELY useful! Thanks!
That and your other projects as well! Learning BBB Gui when I can and looking forward to checking out the landscape/map editors.

Also while I am at it, I found some wonderful code snippets by Neuro Fuzzy and baxslash that are gonna be helpful in current project. Thanks to you guys as well!

I was origionaly going to use objects positioned at built-in limb locations in my models for turrets. Then found that when I moved the Parent object, the positioned objects were offset the movement amount. They snapped back into place after the object stopped moving. Since I didnt find any pages on the problem I decided to work arround it with limbs.
Though just realized today that the EZ rotate basic fixed that problem...(Didn't catch that part when I was reading up on it.)
My first thought after realizing that was "So the limb solution was for nothing?"
Then I realized how with both solutions I can make even more impressive turret effects than before.

Login to post a reply

Server time is: 2026-07-11 14:56:56
Your offset time is: 2026-07-11 14:56:56