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 / Pick limb problem solved

Author
Message
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 18th Feb 2010 16:57
I've been searching around for ages trying to find a "pick limb" type of command,after reading quite a few posts,not may of which were even replied to,and the ones that were sugested making more objects out of the limbs and checking those,seemed a bit wastefull and over complicated,so i've come up with this using sparky's,hope it's of some use,it can deal with both indexed list objects like dbpro's primatives and triangle list meshes like you make a terrain mesh with and dbpro's plane command.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 18th Feb 2010 17:17
In your limb_hit(), why can't you just use "LIMB HIT" or hit limb (not at my home pc right now) to see if the "marker" is colliding with a specific limb.... your "marker" object has only one limb to it so (please forgive the syntax):


Once again, this code won't work by itself and I ma sure there is some syntax error to it because I am not at my home PC.

The fastest code is the code never written.
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 18th Feb 2010 17:35
You could use the built in command,but doing it this way with sparky's you can get the face hit on the limb and with that you can use it in conjuntion with the vertex commands to get the uv data for that point you hit on the limb,so that means i can paint directly onto a 3d object made of lots of limbs and seperate textures,like a landscape,by simply editing the texture in a memblock on the fly in real time.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 18th Feb 2010 18:34
Yes, if you need the UV info, you can't use what I showed you.

The fastest code is the code never written.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 18th Feb 2010 19:58 Edited at: 18th Feb 2010 20:04
@ paul5147,

There's always the DKAVM and DKShop plugins - they used to work - but latest version of those plugins dosnt seem to work with v7.3-v7.5 DBPro...

never got to the bottom of which version would work with v7.4+ but here are some of the relevant links:-

http://forum.thegamecreators.com/?m=forum_view&t=84216&b=5

http://forum.thegamecreators.com/?m=forum_view&t=152426&b=15

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 18th Feb 2010 20:38
Thanks Duffer,i tried them both in previous versions of dbpro,but allways got intermintent problems with some of the commands that i could never get to the bottom of,it would compile and run fine once or twice and then with no changes at all it would just lock up or end sudenly.Is there a version out now thats stable with u7.4?
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 18th Feb 2010 20:53
@ Paul5147, I have emailed Dmitry to see if he's willing to now do a version valid with v7.4 and v7.5+. In the past Dmitry has been very good at updating, so fingers crossed...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 19th Feb 2010 08:39
Thanks Duffer,i've just tried the the latest links to them i could find,and they seem to work ok for now on u7.4,couldn't see a way to use them to get the uv data of the limb though,only the normal of the polygon it hits,but it may just be me not reading all the documents properly.
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 19th Feb 2010 12:32
Quick UV painter demo,not perfect but close enough to get the idea

I've commented out the memblock code and used a sprite intstead for now because thats what i use for making the landscape textures in another program,it works ok,just not very accurate yet.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 19th Feb 2010 14:57
paul5147:

Impressive work! I see that whatever sprite #1 is can be painted on the limbs of an object. There is definitely a lot of potential here.

paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 19th Feb 2010 16:09
slightly better version of the code from above
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 20th Feb 2010 09:43
@ paul5147,

Thanks for that.

I have established that a certain version of the DKPlugin works with DBPro v7.5b4+ and I've attached it here. Happy Days.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-25 15:58:05
Your offset time is: 2024-04-25 15:58:05