Jump to content


Photo

3d Road Rendering


  • Please log in to reply
31 replies to this topic

#21 moomoo112

moomoo112

    GMC Member

  • New Member
  • 663 posts
  • Version:GM7

Posted 15 November 2008 - 06:57 PM

o now this is nice, definatly will help
  • 0

#22 the sivart

the sivart

    GMC Member

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

Posted 23 November 2008 - 02:43 AM

very good :P
  • 0

#23 PaperCutGames

PaperCutGames

    GMC Member

  • New Member
  • 31 posts

Posted 27 July 2009 - 08:05 PM

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.
  • 0

#24 Tepi

Tepi

    GMC Member

  • Global Moderators
  • 4201 posts
  • Version:GM8.1

Posted 27 July 2009 - 08:32 PM

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.

...Or then not. Without collision checking there won't be potential, at least not in the racing side.

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. :mellow:

And by the way, this topic is almost a year old.
  • 0

#25 RamboFox

RamboFox

    Tainted Fortune

  • New Member
  • 992 posts

Posted 28 July 2009 - 04:33 AM

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".

Simple stuff - I did it with a top-down 2D version of this.

And by the way, this topic is almost a year old.

Yeah, well BUMP. >:3

Edited by RamboFox, 29 July 2009 - 01:30 AM.

  • 0

#26 Tepi

Tepi

    GMC Member

  • Global Moderators
  • 4201 posts
  • Version:GM8.1

Posted 28 July 2009 - 12:53 PM

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".

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.
  • 0

#27 RamboFox

RamboFox

    Tainted Fortune

  • New Member
  • 992 posts

Posted 29 July 2009 - 01:35 AM

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, 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.

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).
  • 0

#28 PaperCutGames

PaperCutGames

    GMC Member

  • New Member
  • 31 posts

Posted 29 July 2009 - 04:46 AM

What event in what object wold that go under?
  • 0

#29 Tepi

Tepi

    GMC Member

  • Global Moderators
  • 4201 posts
  • Version:GM8.1

Posted 29 July 2009 - 02:35 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, 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.

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).

It might be slightly wrong because no such thing as path_direction exists.

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.
  • 0

#30 RamboFox

RamboFox

    Tainted Fortune

  • New Member
  • 992 posts

Posted 31 July 2009 - 01:33 AM

Yep, I meant "direction" - because once you set a path to an instance, it takes the form of the path.

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.
  • 0

#31 ean

ean

    GMC Member

  • New Member
  • 190 posts
  • Version:GM8

Posted 24 March 2012 - 07:54 PM

Ooh...nifty. The shadows are a nice touch.

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.

  • 0

#32 THE_GAME_EDITOR

THE_GAME_EDITOR

    GMC Member

  • GMC Member
  • 798 posts
  • Version:GM8.1

Posted 31 August 2012 - 09:33 AM

The texture repeats itself by mirroring it along the path.
If i want the repeat it like normal, what should i do?

Can anyone please tell me?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users