| 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: |
| Deflecting off edges/railings...; Yea | |
|---|---|
| Tweet Topic Started: Sep 18 2007, 07:13 AM (558 Views) | |
| MrUlukai | Sep 18 2007, 07:13 AM Post #1 |
|
Devoloper of Karts.
![]() ![]() ![]() ![]() ![]()
|
So, im making this Go Kart Game, ![]() cute aint it? Anyway, I found out I'm pretty dumb because I cant figure out some good code for collisions with a railing. Cars usually dont move along the edge when they pretty much ram the right corner of the car into a rail. They deflect off, know what I mean. and not just straight rails either, more like curved, as you can see in the screenie. Can someone give an example or maybe some code on how I can achieve more realistic physics. Not super physics or anything, but like a ball deflecting off a curved wall would be nice. Any input is great. Im having coders block or sumthin. Thanks, Brandon |
| * Click here to go to see Brandon Swift's Creations! * | |
![]() |
|
| silverfire56 | Sep 18 2007, 04:04 PM Post #2 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
yay another go-cart but if you want a car example check Here other then that, you will have to figure it out with MATH or even look at the old u3d demo car http://u3d.xinto.net/OldDemoFull.zip |
![]() |
|
| MrUlukai | Sep 18 2007, 04:30 PM Post #3 |
|
Devoloper of Karts.
![]() ![]() ![]() ![]() ![]()
|
Looked at both, the car physics example doesnt really deal with collisions other than z, so that didnt offer much help. And the old demo uses sprites for collision detection and crap. Like if x+32 > other.x Move(BLAH,BLAH,BLAH). But mine is a straight model, Im tryna get raycastin and move to coincide with eachother. Im in my first year of college taking precalc, and all were really doing is reviewin, so my mind is fluttered with parabalas and quadratic equations and all that other bs, and i cant concentrate. Thanks
|
| * Click here to go to see Brandon Swift's Creations! * | |
![]() |
|
| detuhooja | Sep 20 2007, 07:01 AM Post #4 |
|
Advanced Killer
![]() ![]() ![]() ![]() ![]() ![]()
|
mee too MrUlukai i have same problem
but i have can add gravitation but not wall collision with sliding :mellow: ext. i' am using demo's car physics |
| <-> | |
![]() |
|
| silverfire56 | Sep 20 2007, 08:27 AM Post #5 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
ok.. im already doing too much but im making a Mario cart clone so ill upload a example |
![]() |
|
| skarik | Sep 21 2007, 06:05 AM Post #6 |
|
kitten eating scum
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Sorry to butt in, but... You can use the raytracing functions, get the normal of the wall you're going to smash into, and then use that normal thingy to get your direction to bounce to.
|
| Blog|EHS | |
![]() |
|
| MrUlukai | Sep 21 2007, 06:19 AM Post #7 |
|
Devoloper of Karts.
![]() ![]() ![]() ![]() ![]()
|
Ahh i c, that would be exactly what I need. Can you give some type of example code? That would be wonderful. Oh and PreCalc is Pre-Calculus or Algebra & Trigonometry some people call it. |
| * Click here to go to see Brandon Swift's Creations! * | |
![]() |
|
| skarik | Sep 22 2007, 05:20 AM Post #8 |
|
kitten eating scum
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Yeah, I know. I'm taking it as my second year of math in high school. BTW, I think this may work. It works with my alignment function.
|
| Blog|EHS | |
![]() |
|
| MysteriXYZ | Sep 22 2007, 04:59 PM Post #9 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Instead of the above, you can just write:
No need to complicate things ;). |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| MrUlukai | Sep 22 2007, 06:20 PM Post #10 |
|
Devoloper of Karts.
![]() ![]() ![]() ![]() ![]()
|
WTF? Child prodigy or something? Roflz... Where you live? But ya, thanks for that guys, Ill check it out. Brandon. |
| * Click here to go to see Brandon Swift's Creations! * | |
![]() |
|
| MrUlukai | Sep 23 2007, 08:33 AM Post #11 |
|
Devoloper of Karts.
![]() ![]() ![]() ![]() ![]()
|
Ok, It looks like it should work perfectly, but Im getting some weird Blank Message Pop up everytime a collision is made...? My Code is basically. GetDistanceToModel(global.level,x,y,z-2,0,roty2); ray_normal = GetRayTracingNormal(-1); In a nutshell. And I guess Everytime I GetRayTracingNormal, It pops up. ?? any thoughts? PS. Ive now got snowmans.
|
| * Click here to go to see Brandon Swift's Creations! * | |
![]() |
|
| detuhooja | Sep 23 2007, 01:09 PM Post #12 |
|
Advanced Killer
![]() ![]() ![]() ![]() ![]() ![]()
|
ok write here,because i dont want make own topic for this. can somebody help me make car physics.it need wall slide collision please help i need it.i have game with story and all what need for it,only models and graphic need to do if somebody help i will release maybe demo in sometime edit:should i give what i have already? its only demo's car physic and i cant set gravitation,collisin and car moving on model in both """""""""""silverfire are you doing example yet?"""""""""""""""""""""""""""" CREDITS FOR HE WHO CAN HELP! |
| <-> | |
![]() |
|
| silverfire56 | Sep 23 2007, 02:40 PM Post #13 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
there are a million people who manage their time better then i. i have swamped myself with things too do right now i can think of 8 things that i need to do (including the helicopter, i haven't forgotten) and naturally having done work for a entire term i need a break. but it is equal 2rd on my "to do" just hang in there for a few days, i have Thursday and Friday off.
|
![]() |
|
| detuhooja | Sep 23 2007, 02:53 PM Post #14 |
|
Advanced Killer
![]() ![]() ![]() ![]() ![]() ![]()
|
ok i just asked, because i have time for game making but its stybid to do something if it can't make.ext i would do models for my game but why do if i car didn't work and then game didn't work
|
| <-> | |
![]() |
|
| MysteriXYZ | Sep 23 2007, 04:54 PM Post #15 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Did you make sure to release ray_normal at the end of your code? Like this:
If you didn't, you will eventually create too many vectors and this leads to an error message (no idea why yours is blank, though). Alternatively, you can initialize ray_normal once in the Create Event of the object that calls your code:
and then use it in your code like this:
Then you only need to release it in the Destroy Event of that object. Hopefully this helps. |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)




2:35 AM Jul 11