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 / Collision of 3d models

Author
Message
trohn
15
Years of Service
User Offline
Joined: 20th Apr 2011
Location:
Posted: 20th Apr 2011 18:55
I'm relatively new to darkbasic pro, so, just a disclaimer, a lot of what I'm doing is simply guess work. I've worked on a couple of projects for a class, and in my current project, I'd like to use a maze. I thought that it would be easier to to use blender---which I am also new at---to design a .x model of a maze. I've created the model, but right now I'm working with something smaller (like a 3d t-shaped tetris piece) to test the coding in darkbasic. After working with the size, I finally have an understanding of positioning and scaling of the object (I don't fully understand how blender scales objects, but I've had to scale to like 25000 or something like that to get it to be 500 pixels in darkbasic). Anyways, my problem is the collision. No matter how I go about setting the collision, darkbasic will only see the (x1,y1,z1,x2,y2,z2) coordinates of the shape, causing it to make a box out of the outermost edges of the model, making everything on the inside of that box a "collision". Is there a way of causing the collision to fit a more complex shape, or see it as more than simply two coordinates?
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Apr 2011 19:16
Standard collision works on just boxes and spheres. It will - as you have found - just put a collision box around your object.

Additionally, your box is the "solid object". You can collide from the outside, but not the inside.

A simple solution is to make your walls from separate boxes, that solves all of your problems - except being able to create a complex model of your maze.

It would be worth looking for the threads on Sparkys collision (search box at the bottom of the page). It will give you a lot better control over collision, and will also give you plenty of discussion on designing worlds for detecting collisions.

GreenDixy
17
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 20th Apr 2011 20:24
sparkys collision0 works well i think they should include it by defualt as the standard one instead of what is built in now

======================================

GreenDixy Productions http://GreenDixy.Com
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 21st Apr 2011 01:56
Quote: "Is there a way of causing the collision to fit a more complex shape"

Yes, there is polygon collision but that needs a lot of processing and can cause a significant drop in fps. So like everyone has suggested, look up sparky's collision which has a function that allows you to set up an object for simplified polygon collision. Look up sparky's sc_setupcomplexobject command.

No one has posted a link to sparkys so here it is:
http://forum.thegamecreators.com/?m=forum_view&t=31051&b=5

A clever person solves a problem, a wise person avoids it - Albert Einstein

Login to post a reply

Server time is: 2026-07-18 06:41:28
Your offset time is: 2026-07-18 06:41:28