# 3D Model Collision Problem

4 replies to this topic

### #1 GamingBud

GamingBud

GMC Member

• New Member
• 20 posts
• Version:GM8

Posted 22 June 2012 - 12:45 AM

Hey guys!

i just wanted to ask can someone give me the exact code for this...i have gmnewton and i want to make my object move in the direction im pushing it heres something that kind of explains what im trying to say:

By 1800askgeek: To the extend of my knowledge, there are two (simple) ways to do this: if your game is effectively 2d with 3d graphics (like Mark Overmars's example) you can use GM's collision detection, which is essentially a bounding box. If you have more 3d movements, like jumping and falling, you will probably need to move your bounding boxes into 3d space.

Consider a crate placed in the middle of a room. It has length, width, and height, and you need to check the moving object's location relative to the 3d-box. Extending this idea to something like a sphere, you can get a good approximation of the shape of the sphere by taking the diameter of sphere and using that as the length, width, and height of the bounding-cube. Make sense?

Another way you could do it is precise-collision checking using polygons. Considering the surface of each polygon that is in the checking region, and then seeing if another polygon (the moving object) intersects that polygon. Doing this manually would require some expensive math, so, unless someone's got another method that I don't know about, you'll probably want to stick with bounding-box/cubes.

One work around would be to break a complex object into a series of 3d bounding-boxes, which would let you make something arbitrarily complex.

now all i want is just pushing not falling on it or anything just right, left, forward and backwards thats all i want and if someone could give me the exact code to get the box to like spin around if the way you push it is just right and pushing it away that would be awesome!
• 0

### #2 PoniesForPeace

PoniesForPeace

puzzling

• GMC Member
• 493 posts
• Version:GM:Studio

Posted 22 June 2012 - 02:11 AM

um i dont have the exact code but honestly gm newton isn't gonna give u that much of a headache.

basically, you want the player to be a cylinder with forced rotation so its upright, and u want the crate to be a basic cube.

If you force the cylinder to the player x y it wont work (most physics engines are like this, unfortunately.)

I think you have to force the player to the cylinder x,y, and apply forces to the cylinder.

Try to at least see if the boxes are working first.

dont worry about trimesh either, just use a floor the size of the room for everything to fall on.

Edited by PoniesForPeace, 22 June 2012 - 02:12 AM.

• 0

### #3 GamingBud

GamingBud

GMC Member

• New Member
• 20 posts
• Version:GM8

Posted 22 June 2012 - 02:49 AM

um i dont have the exact code but honestly gm newton isn't gonna give u that much of a headache.

basically, you want the player to be a cylinder with forced rotation so its upright, and u want the crate to be a basic cube.

If you force the cylinder to the player x y it wont work (most physics engines are like this, unfortunately.)

I think you have to force the player to the cylinder x,y, and apply forces to the cylinder.

Try to at least see if the boxes are working first.

dont worry about trimesh either, just use a floor the size of the room for everything to fall on.

oh hey also the scripts dont work for my game maker i have game maker 8.1 standard but when ever i try it with a script it says something like error getting the script
• 0

### #4 PoniesForPeace

PoniesForPeace

puzzling

• GMC Member
• 493 posts
• Version:GM:Studio

Posted 22 June 2012 - 02:11 PM

um i dont have the exact code but honestly gm newton isn't gonna give u that much of a headache.

basically, you want the player to be a cylinder with forced rotation so its upright, and u want the crate to be a basic cube.

If you force the cylinder to the player x y it wont work (most physics engines are like this, unfortunately.)

I think you have to force the player to the cylinder x,y, and apply forces to the cylinder.

Try to at least see if the boxes are working first.

dont worry about trimesh either, just use a floor the size of the room for everything to fall on.

oh hey also the scripts dont work for my game maker i have game maker 8.1 standard but when ever i try it with a script it says something like error getting the script

yes that is not ur fault its a bug in newton. I think you have to manually get the xyz and in the step instead of using the auto xyz finder. See if you can find out more about it in the Gm newton posts.
• 1

### #5 GamingBud

GamingBud

GMC Member

• New Member
• 20 posts
• Version:GM8

Posted 22 June 2012 - 06:43 PM

um i dont have the exact code but honestly gm newton isn't gonna give u that much of a headache.

basically, you want the player to be a cylinder with forced rotation so its upright, and u want the crate to be a basic cube.

If you force the cylinder to the player x y it wont work (most physics engines are like this, unfortunately.)

I think you have to force the player to the cylinder x,y, and apply forces to the cylinder.

Try to at least see if the boxes are working first.

dont worry about trimesh either, just use a floor the size of the room for everything to fall on.

oh hey also the scripts dont work for my game maker i have game maker 8.1 standard but when ever i try it with a script it says something like error getting the script

yes that is not ur fault its a bug in newton. I think you have to manually get the xyz and in the step instead of using the auto xyz finder. See if you can find out more about it in the Gm newton posts.

ok thank you but im really close to figuring out how to make the boxes move without this on my other topic witch is called: 3D Collision Problem
• 0

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users