Posted: 22nd Jun 2007 18:16
Hey all, my friend is trying to figure out DB Pro and wants to know how he makes the ground solid so his player cube object won't go through it on collide.

I have darkphysics so I have completely forgotten how to do this normally. Help much appreciated
Posted: 22nd Jun 2007 18:22
Is he using an object, a matrix, or advanced terrain?

I don't know how advanced terrain works, so I only have two solutions:


Object (mesh): You can do a few different things to collide with a terrain (or any kind of world) if it is a mesh object. You can use raycasting (intersect object) and work out your own subroutine/function, or you could use one of the many collision plugins available. Sparky's DLL, Newton, Nuclear Glory (costs money), etc.

Matrix: Simply use the y# = Get Ground Height( x#, z# ) to retrieve the height of the ground where the player is at x# and at z#. The value will be returned to the variable y#, so you can align your player to that.
Posted: 22nd Jun 2007 21:38
Should be:

y# = Get Ground Height(MatrixNumber, x#, z#)

Only a typo, but might cause you problems if you are unfamiliar with the command.

TDK_Man
Posted: 27th Jul 2007 4:11
I made him a pretty advanced terrain in 3ds max, so anyone know how he might get that to work?
Posted: 27th Jul 2007 4:19
I THINK Advanced terrain is

Get Terrain Ground Height(objTerrain,X#,Y#,Z#)

The original (broken) terrain I think is the same less the actual word Terrain.

As for the 3Ds thing - can you export to *.X - MANY people here say 3ds is "broke" or is buggy. Make it a direct x object and THEN work with it like an object. Use sparky's dll for sliding on it (which can get stuck on simple angles...I made a simple ramp... and slide would not slide on it but other ramps it woould) so your own object collision might be best - but to get the slide - if the slide for sparky's does to you what it did to me - then you can use either or both - object collision and ray tracing. though I haven't tried ray tracing - or ray casting or whatever myself yet.

Good Luck.
Jason P Sage
Posted: 27th Jul 2007 5:54
if you want to make your own slider you set object collision to polygons on the ground object.
Posted: 27th Jul 2007 7:47
I find it funny that I could do this in maybe 3 minutes in blitz but it takes hours in dbpro...

But I know that in the end it will pay off

And ty, I'll try sparky's.
Posted: 30th Jul 2007 21:12
it takes hours to get it so the player doesn't go below the ground? :/
Posted: 30th Jul 2007 21:54
Wouldn't "Intersect Object" work fine for this, though it's not as fast as Sparky's but it works well enough.
Posted: 31st Jul 2007 2:12
Sparky has a routine to calc where next to go if current "attempted move" sends you through "object" (Ground or floor).

I must say that the Slide routines work great some times - more of a "STOP you can't do that" other times - both situations without crashing - both situations definately usable. Using regular collision you can make your own slide in theory, however other than that there isn't to much else - but many of us seem to get by reasonably well with this option.

I'm a bit shocked about the BlitzBasic few minutes statement. Nothing bad or anything - just that with my playing with it the commands seems more macro-ish in many cases for many tasks - with many parameters to set up - but once done - it was like you wrote a whole complex function in a couple lines. In DB Pro, everything (Except maybe Matrix and Advanced Terrains) is broken down into fairly low level control constructs - and sometimes I to get frustrated when doing common things find certain "code sequences" constantly in need (which I typically make a function for if it can be reusuable) but I often need those same commands for a variety of other things so it works out. Some things take seconds in DBPro while others take forever and vice versa with Blitz. Many have migrated to DBPro so there must be something good here. Additionally - if the guy who made Blitz came out with a super DirectX version or something I'd try that too with unbiased vigor

Jason P Sage
Posted: 31st Jul 2007 5:02
For matrix, I just put:

+ Code Snippet
POSITION OBJECT 1,OBJECT POSITION X(1),GET GROUND HEIGHT(1,OBJECT POSITION X(1),OBJECT POSITION Z(1))+5,OBJECT POSITION Z(1)


In the main Loop