|
Post by Supermonkey on Apr 30, 2010 10:27:31 GMT -5
I'm not much of a maths whizz, the most I did was an intro to 3D graphics course at uni and I was litterally in tears whilst doing the coursework . Infact my lack of maths knowledge is why at a very young age I realised I wasn't ever going to be a games programmer. However, now many years later I'm interested in doing a bit of games programming. I've taken a look at some tutorials and their is just too many calculations for my liking, does anyone have a working example I could look at? I tried searching the forums, I only found some code of davy's that was no longer available for download.
|
|
|
Post by DJLinux on Apr 30, 2010 11:07:09 GMT -5
What do you mean with Sliding Collision ?
Joshy
|
|
|
Post by Supermonkey on Apr 30, 2010 12:31:41 GMT -5
Well the response to the collision is for the object to slide along the plane of the other object, it's commonly seen in FPS games. When you collide with an object it doesn't cause the player to get "stuck".
|
|
|
Post by shadow008 on Apr 30, 2010 13:29:26 GMT -5
why not instead of when colliding with an object to stop, just deflect velocity?
|
|
|
Post by Supermonkey on Apr 30, 2010 16:01:37 GMT -5
Wouldn't that have the same effect (i.e. stop the player)? I'm thinking in a 3D world, handling walking up ramps, going up stairs, walking on a terrain, these would all use a "sliding" response would they not? My understanding of collision detection/response doesn't go much past 2 dimensional techniques, such as basic boundary checking and some simple line/ray intersect.
|
|
|
Post by matthew on Apr 30, 2010 18:05:08 GMT -5
I don't know if they're the ones you're looking for but I've done some searching on my hard-drive & found some of the terrain collision programs that davy *wrote* a while back. Attachments:
|
|
|
Post by Supermonkey on May 1, 2010 3:09:22 GMT -5
Yep, that's what I was after, cheers . [edit] Ah it's not as hard as I thought. Usually tutorials are a good thing, in this case just looking at code was a lot easier.
|
|
|
Post by matthew on May 1, 2010 4:54:13 GMT -5
You might find this useful as well, when Xenovacivus created his collision detection dll he also wrote a program in C++ that would load an .obj file & let you move around it. The source is included too. Attachments:
|
|
|
Post by Supermonkey on May 1, 2010 4:59:01 GMT -5
That's even better, thanks .
|
|
|
Post by twasik4 on May 3, 2010 11:25:12 GMT -5
Those downloads seem like a job for my file sharing website for B4GL xD
|
|
|
Post by DJLinux on May 3, 2010 12:32:25 GMT -5
With the Colllision Plugin you get all infos you need. The triangle of collision the point of collision and the face/triangle normale. The angle between the face normal and players direction are simple the dot product. CosAngle = DotProduct(FaceNormal, PlayerDirection) Now mirror the PlayerDirection soft or sharpen around the FaceNormal Joshy w = wall pd = player direction pc = point of collision fn = face normale s1 = from soft s2 = to s3 = hard sharped new player direction top view
w pd | / | / | / | / |/ pc-------fn |\\ ||\ \ || \ \ || \ \ | | \ \ | | \ \ | | \ \ | s1 s2 s3
|
|