Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Moving down a slope; Collision Question
Topic Started: Dec 3 2007, 09:01 PM (232 Views)
DJB MASTER
Newbie
[ * ]
Hi i am totally confused when it comes to collision and i really need to sort this out if i'm to continue my game.

I have this slope model and a simple block...

Posted Image

What i want is the block to detect upwards and downwards of the block and rotate accordingly when moving up or down.

I have programmed nothing to do with collision before so i'm a little stuck where to begin. The block is in the air at the moment so i need gravity implemented also.

Can anyone help?

Thanks
Offline Profile Quote Post Goto Top
 
Rixeno
Member Avatar
Teo-Carliss
[ *  *  *  *  * ]
You gotta at least try to do this, and if you have, post your code so we can correct you ;)
Report spam the nanosecond you see it.
Ninjas are everywhere, for all you know there are eleven behind you right now, including me...
Offline Profile Quote Post Goto Top
 
Zedman3d
Member Avatar
Forum God
[ *  *  *  *  *  * ]
This may help you:

http://forum.ultimate3d.org/index.php?showtopic=1440
Quote:
 
Eanbro: My problem with C++ is that not everything is included to start making projects with it.
Quote:
 
Dr.B: Your problem with C++ is that you want it to be like Game Maker...
Offline Profile Quote Post Goto Top
 
DJB MASTER
Newbie
[ * ]
Sry guys if i seem selfish to ask for all the work to be done its just that i have no idea where to start. The help file isnt exactly clear and i have never programmed collision before in any game engine or programming language.

I'll have a mess about with a couple of functions to first see if i can make the block fall under gravity and stop when it touches the slope.

EDIT>>

Ok i have messed about with a couple of lines of code and now the block falls and when it touches the slope it stops...

Step Event>

Code:
 
block.z-=0.3

distance_down=GetDistanceToModel(slope.id,x,y,z,90,0);

if distance_down<0.5 {block.z=block.z+0.5}


Am i going the right way about this?
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply