New to 3D,need help, collisions and walking

Blitz3D Forums/Blitz3D Beginners Area/New to 3D,need help, collisions and walking

CloseToPerfect(Posted 2011) [#1]
Ok, 1st off I am a total noob at 3D programming, but am a very experienced programmer.

My project is a cubed tile map world, think super mario brothers but with 3d tiles instead of 2d.

What I've done,
I started with using the cube mesh but realized that I need alot of cubes and there would be alot of sides not shown, I also realized that cubes have the same texture for all 6 sides. So I made my own cube model with 6 surfaces, I can apply different textures to different sides and I set 3 collisions types,
1, top that you walk on
2, bottom that stops you when jumping
3, sides that stop you when walking

My rending engine wont draw surfaces that are side by side like when 2 cubes are stacked. there is no way to ever see that surface so no reason to render it. I hoping this will increase the framerate when I have really large worlds with many thousands of Blocks in it.

I have jumping and gravity added and collision.



So where am I,
I am probably not using collisions right because the collision overrides my walking. Right now I have a sphere for the character.

Collisions sphere,TOP,2,1
Collisions sphere,BOT,2,1
Collisions sphere,SID,2,1

So this stops the sphere when falling and it hits the ground but also stops him from walking because it see a collision. I only see 3 reactions to the collision

1: stop
2: slide1 - full sliding collision
3: slide2 - prevent entities from sliding down slopes

So what I want,
I want to be able to detect the collision and then use my own function depending on collided object.

Like I said complete noob and I probably am missing some command that would allow this but I thought I would ask the more experienced people here.

Any pointer or suggestions,
CTP


jfk EO-11110(Posted 2011) [#2]
If I was you I'd use only one type of collsion: sphere vs polygon (player vs world).
You can use an ellipsoid radius for the player collision. This works for most situations.

Now, for No-response collision checks I have to say it needs some additional lines because UpdateWorld does both, detecting collsion and handle the responses. What you need to do is this:

move player
store new xyz
updateworld()
check collisions
position player at stored xyz
do your own collsions handling here
renderworld

To be able to move your player regardless of surrounding map elements you may have to resetEntity it, in order to forget the collsions and allow it to go trough walls. You can also use HideEntity/Showentity, it does erase the collsion handler too.