3d Road Rendering
#21
Posted 15 November 2008 - 06:57 PM
#22
Posted 23 November 2008 - 02:43 AM
#23
Posted 27 July 2009 - 08:05 PM
#24
Posted 27 July 2009 - 08:32 PM
...Or then not. Without collision checking there won't be potential, at least not in the racing side.11/10. THREE thumbs up. Has a lot of room for potential. Driving sim, roller coaster sim, 3d racing (like that of the gran turismo series, only in first person). It is endless! Kudos to you.
And this is actually rather trivial to do if you know what you're doing. I know as I did a similar engine a short while ago. That supports also inclination.
And by the way, this topic is almost a year old.
#25
Posted 28 July 2009 - 04:33 AM
Simple stuff - I did it with a top-down 2D version of this.
Yeah, well BUMP. >:3And by the way, this topic is almost a year old.
Edited by RamboFox, 29 July 2009 - 01:30 AM.
#26
Posted 28 July 2009 - 12:53 PM
Yes. Too bad though that that can't ever be precisely correct with that method. The path isn't subdivided like the road is, you know.Actually Tepi, you can implement collision detection - all we need is the height (z variable) which is taken from a path (we can check against the path's y position) apply gravity, constrict the z var to never be able to go under the z of the path - and simply check how far the car is from the centre of the track to determine when to bounce off the "boundry".
#27
Posted 29 July 2009 - 01:35 AM
Actually, I have recently tested out a method where the car can only move forward, and pressing left and right increases/decreases the ofset along the path direction.Yes. Too bad though that that can't ever be precisely correct with that method. The path isn't subdivided like the road is, you know.
Think of it like so:
draw_x=x+lengthdir_x(ofset,path_direction+90) draw_y=y+lengthdir_y(ofset,path_direction+90)I don't have GM with me right now, so this code may be slightly wrong (but I think you'll catch my drift).
#28
Posted 29 July 2009 - 04:46 AM
#29
Posted 29 July 2009 - 02:35 PM
It might be slightly wrong because no such thing as path_direction exists.Actually, I have recently tested out a method where the car can only move forward, and pressing left and right increases/decreases the ofset along the path direction.Yes. Too bad though that that can't ever be precisely correct with that method. The path isn't subdivided like the road is, you know.
Think of it like so:draw_x=x+lengthdir_x(ofset,path_direction+90) draw_y=y+lengthdir_y(ofset,path_direction+90)I don't have GM with me right now, so this code may be slightly wrong (but I think you'll catch my drift).
But don't try to come up with anything. If you still didn't get my point, it was that the road consists of triangles, and nothing more but triangles. A path is always too smooth for it to be exactly correct. So as long as your road doesnt work in the precision infinity (always), you will end up under or over the specific z-coordinate you'd normally want to be on.
The technique you'd be searching for indeed relates to finding the normal of the path, but I can tell you the rest of the math is not just elementary math. It relates to the triangles, and there's no way around it.
#30
Posted 31 July 2009 - 01:33 AM
We could come to a close approximate to the actual height, but yes - the way you described it will end up with the car diping below the track at some points.
#31
Posted 24 March 2012 - 07:54 PM
There is no such thing as a path direction function, but you can make your own.
To get the direction of a path on any part of the path, use point_direction(path_get_x(pos1),path_get_y(pos1),path_get_x(pos1),path_get_y(pos1)).
Using really small digits (like .0001) and you can get a really accurate result.
Edited by ean, 24 March 2012 - 07:56 PM.
#32
Posted 31 August 2012 - 09:33 AM
If i want the repeat it like normal, what should i do?
Can anyone please tell me?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











