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 / ODE Triangle Mesh Example. I got the triangle mesh working in ODE!

Author
Message
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 17th Feb 2007 23:42 Edited at: 9th Mar 2007 16:35
I've finally figured out how to get ODE to work correctly with a triangle mesh level! I've attached the example to my post. I've included with it the ODE dll that works for 6.2 and above. The dll has been recompiled to use the latest version of the ODE library. If the example doesn't work, try putting the new ode dll in the plugins-user folder.

You need the latest version of DBPro (6.4) for this to work. You also need to replace the current ode dll that is in the plugins-user folder with the dll included in the zip file. You will need the October 2006 dx runtime or later since I compiled the dll using that version of the sdk.

Enjoy!

-Coolgames

Attachments

Login to view attachments
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 18th Feb 2007 03:28 Edited at: 18th Feb 2007 03:52
I'm testing this now, i always wished the triangle mesh features would work.

[EDIT] It seems you didn't include the functions you use to get player and camera position/rotation. For example, you have 'campx()' in your code but there is no function defined as 'campx()'. Will test once i change all those back.

[EDIT2] It doesn't work for me, i just get an error when i try to run it.

Who needs a signature?
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 18th Feb 2007 04:06
It does for me as well.

Windows just gives me notice of an error and terminates it.

coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 18th Feb 2007 05:25
Oops. I've fixed it now. Just download it from the first post.
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 18th Feb 2007 10:35
Works fine for me!

Can you position map.dbo freely or is it always in 0,0,0 ?
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 18th Feb 2007 15:36
Works fine here also. I might convert your sample to work on DGDK.NET using the ODE plugin for that as well.... if you don't mind of course?

Paul.

Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 18th Feb 2007 18:44
Still crashes for me

Trinita
20
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Italy
Posted: 19th Feb 2007 14:41
It does not work for me. I have DBpro ver 6.2.
I've tested the Dll on another project but it does not work. I've tested the code with the old Dll and it does not work.

Any ideas?

"An eye for an eye will only make the whole world blind."
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 19th Feb 2007 17:04 Edited at: 19th Feb 2007 17:05
Apexnow, yes you can convert it. Just put my name in it.

Image All, can you tell me what error message you get?

Trinita, does it crash on compile, or does the collision not work correctly?

Juso, I don't think you can reposition it after you use "ode create static triangle mesh", but you can reposition it before.
Trinita
20
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Italy
Posted: 19th Feb 2007 17:09
It crashes on compile.

"An eye for an eye will only make the whole world blind."
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 19th Feb 2007 19:09
What error do you get?
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 20th Feb 2007 03:05
Here's a new version that is in 3rd person instead of first. I've fixed the problem where you slide down a slope. This new version requires sparky's collision dll which can be downloaded here: http://forum.thegamecreators.com/?m=forum_view&t=74762&b=5

Attachments

Login to view attachments
Trinita
20
Years of Service
User Offline
Joined: 29th Sep 2003
Location: Italy
Posted: 20th Feb 2007 11:07 Edited at: 22nd Feb 2007 17:32
The exe file (ode.exe) doesnt work, with the new dll and with the old. It simply opens an windows XP error window. I've tried with the new one (i already have sparky) you uploaded, but gave me the same result.

My specs: Windows XP Pro sp2 -- DirectX9.0c -- 1 Gb RAM -- Intel P4 3.00Gb -- RADEON X700 PCIExpress 128 mb -- DBPRO ver 6.2b

[EDIT]: It's working, i dont know how i did it...great!

[2nd EDIT]:It works only in debug mode with old ddl. I must upgrade to 6.4....

"An eye for an eye will only make the whole world blind."
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 22nd Feb 2007 00:01
For those people that can't get it to work. Read the first post again, I've edited it to tell how to get it to work.
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 22nd Feb 2007 12:43
I still wonder how to reposition the ode object. It always stays in 0,0,0

map.dbo can sure be positioned but then it and ode object are in different places
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 22nd Feb 2007 13:32
Juso, do you mean before starting the simulation? If so, reposition the object before applying the ode create dynamic triangle mesh or related command.

If you're talking about move the object after or during simulation, the best way is to cancel the ODE mesh object, reposition it and reassign it to the simulation again. Moving objects directly during simulation isn't really a good idea as it b0rks the behaviour up a bit.

Paul.

Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 23rd Feb 2007 10:16 Edited at: 23rd Feb 2007 10:20
@APEXnow
Where exactly should positioning take place in this example (coolgames above) before simulation. There are only six lines, I have tried all! Moving eg map slightly to left 70,0,0 but how? "Position object 1,70,0,0" or "Position object 3,70,0,0" moves map not ode object

load object "mediamap.dbo",3
make mesh from object 1,3
convert mesh to vertexdata 1
make object 1,1,0
exclude object on 1
sc_setupcomplexobject 3,1,4

`triangle mesh...
ode create static triangle mesh 1
ode set contact fdir1 1,20
...
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 23rd Feb 2007 16:38
You need to position both object 3 and object 1 to the desired position before you call ode create static triangle mesh.
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 24th Feb 2007 11:14 Edited at: 24th Feb 2007 11:22
No it wont succeed !
I really think its unpossible to position ode triangle mesh elsewhere than in 0,0,0
Can someone solve this problem?

...
load object "mediamap.dbo",3
make mesh from object 1,3
convert mesh to vertexdata 1
make object 1,1,0
exclude object on 1
sc_setupcomplexobject 3,1,4
position object 1,70,0,0 `here you try position ode object
position object 3,70,0,0 `and map... but ode stays in 0,0,0

`triangle mesh...
ode create static triangle mesh 1
ode set contact fdir1 1,20
...

Here only map is moved, ode stays in 0,0,0
Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 24th Feb 2007 13:02
change this:


to this:


this will reset objects pivot so that the new objects position is interpreted as the default NON-modified position.

Then ODE should create collision mesh perfectly.

AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c, DBP 6.2
http://www.myspace.com/producerolby
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 24th Feb 2007 13:43 Edited at: 24th Feb 2007 13:44
No way
"fix object 3" doesnt change anything, not even
both "fix object pivot 1" and "fix object pivot 3"

More ideas, please!
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Feb 2007 16:34 Edited at: 24th Feb 2007 16:37
Im convinced the implementation of ODE Physics for the DBP Engine basically blows, theres gotta be something better. Sorry to say.

EDIT: Ok, that was a little harsh, it might be really nice for limited number of certain types of things (uses) but not to stable/capable for more complex things.

London 7/7/05 = 1 in 10^38 Alex Jones: Terror Storm
Ron Paul '08
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 8th Mar 2007 02:20
I've attached a fixed version of the dll. This will allow you to reposition the object before you call "ode create static triangle mesh".

Attachments

Login to view attachments
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 8th Mar 2007 12:41
Thanks coolgames, but this new dll crashes both in 6.3 and in 6.4
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 8th Mar 2007 16:09
It does? It works fine on my computer. Can you give me the error message?
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 9th Mar 2007 15:56
I might have dx9 feb 06 or apr 06. Should I need newer?
I will test it more at weekend.
coolgames
18
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 9th Mar 2007 16:34
You need October 2006 or later.
Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 24th Apr 2007 12:36
It crashes for me too

right after compile has finished I get a "ode.exe has noticed a problem and needs to be terminated" error message!!!

how can I fix this
Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 24th Apr 2007 12:41
I've replaced the old dll, have the latest version of dx and dbpro and it still doesn't work
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 26th Apr 2007 17:30
Someone c++ guru should take this as a challenge and fix that dll
Gnomes Games
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: FRANCE
Posted: 29th Apr 2007 13:31 Edited at: 29th Apr 2007 23:36
Hello ,I use ode in my games and it works fine with everything !

Just use : -DBpro version 6.1
-This version of the Ode DLL post by IanM (Download)
-This code to load a Triangle Mesh :


To install DBpro 6.1 you must uninstall Dbpro completely if you have a newer version ( sorry...) and download the update from : http://darkbasicpro.thegamecreators.com/?f=upgrade_6_1

EDIT : You can position object during the game with this version of the DLL by using the command : "ode set object position object,x,y,z"

Good luck !

AMD Athlon 64 3400+/1 Go DDR/Ati X600 512 Mo/260 Go HD/Windows XP SP2/DirectX 9.0c (October 2006)/Dark Basic Pro 6.0 RC10
Sorry for my so bad english...

Attachments

Login to view attachments
Gnomes Games
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: FRANCE
Posted: 1st May 2007 15:30
Nobody wants to try ?

AMD Athlon 64 3400+/1 Go DDR/Ati X600 512 Mo/260 Go HD/Windows XP SP2/DirectX 9.0c (October 2006)/Dark Basic Pro 6.0 RC10
Sorry for my so bad english...

Login to post a reply

Server time is: 2024-04-19 05:46:13
Your offset time is: 2024-04-19 05:46:13