Forums
road tracing - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4)
+--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9)
+--- Thread: road tracing (/showthread.php?tid=954)

Pages: 1 2 3


road tracing - alex25 - 05-07-2008

while playing with yet another track conversion i ran across an interesting problem. the track itself is modeled as two sections. most of the time they are at the same bank angle and thus could be modeled as one but there are parts where the two sections have different bank angles and if i were to trace it as one section the traced road will be above (or below) the real road. this is a picture of the turn where this is most noticeable:

[Image: track.jpg]

some of the problems i am having with having the sections traced separately:

you can clearly see two racing lines. i wish there was a way to combine them. if i were to have an ai car race along i am not sure what racing line it would be supposed to follow.

lap sequences don't work. i tried choosing 4 sequences, 2 on each road but it didn't help. but this problem is more general as if i were to choose one lap sequence at the starting grid and then go through the pit vdrift wouldn't think i completed the lap even though i did. maybe we should consider a more generic mechanism where we can extend the lap sequence past the traced road somehow.

anyway this is sort of academic since i don't have permission to release this particular track but the above problems are more general.

--alex--


- rookie1 - 05-07-2008

Each Bezier patch has 16 control points (a 4x4 grid). My understanding is that the track editor only allows you to select the 4 corner points. The rest are linearly interpolated using these 4 points. If the track editor has an option to allow a user to manually pick all the control points, it should solve your first problem.


- joevenzon - 05-10-2008

Could you trace whole whole road as one track instead of two by ignoring the centerline? That is, select the left side of the road and the right side of the road as you trace instead of using the centerline.


- alex25 - 05-10-2008

joevenzon Wrote:Could you trace whole whole road as one track instead of two by ignoring the centerline? That is, select the left side of the road and the right side of the road as you trace instead of using the centerline.

i could but in turns the two sides have different bank angles and the traced road would be above the real road (and not an accurate representation of the track at all).

--alex--


- joevenzon - 05-12-2008

Ah. Yeah, to deal with that we'd need to allow you to set more bezier control points in the track editor.


- alex25 - 05-13-2008

joevenzon Wrote:Ah. Yeah, to deal with that we'd need to allow you to set more bezier control points in the track editor.
how hard would it be to implement that?

--alex--


- joevenzon - 05-13-2008

There'd need to be some way to tell the track editor you want to construct a road with a middle point, code to allow you to select 3 points for each new road segment, and code to generate the resulting control points. It's not a quick & easy hack. By the way, so we're on the same page, the goal would be to make the whole road smooth, but with a bend to it, right?


- thelusiv - 05-14-2008

If you're going to change it, might as well not limit it to 3 points for the road segment, but just be able to define the road segment as any set of points greater than one.


- alex25 - 05-14-2008

thelusiv Wrote:If you're going to change it, might as well not limit it to 3 points for the road segment, but just be able to define the road segment as any set of points greater than one.

i agree with you here. use the left mouse button to select as many points as you want (up to a maximum if theres is an intrinsic limit) and then click on the right button to pick the last point and define the segment. 3 or more points would help in some cases but most of the time you would still use just two points.

--alex--


- joevenzon - 05-14-2008

alex25 Wrote:use the left mouse button to select as many points as you want (up to a maximum if theres is an intrinsic limit) and then click on the right button to pick the last point and define the segment

Good idea. The limit would be 4.


- joevenzon - 03-03-2009

Okay, I have initial experimental support for 4-vertex tracing in R75 of the track editor. I haven't tested it much at all so let me know what you find. Press 2 and 4 to switch between the modes. Switching between modes is fine anytime (even within the same road) except if you've already got a vertex selected; finish up selecting the verts for the next patch and THEN switch modes. Auto-tracing will only trace using 2 verts (would you like auto-tracing with 4 verts?).


- alex25 - 03-03-2009

joevenzon Wrote:Okay, I have initial experimental support for 4-vertex tracing in R75 of the track editor.
can we have a 3-vertex tracing mode? most tracks have just one inflection point in the middle (just like the above track) so 3-vertex tracing makes sense for them. as for auto tracing, if it's doable i wouldn't mind but it's something i can live without.

--alex--


- joevenzon - 03-04-2009

The 3-vert mode is in R76. Auto-tracing for 2, 3, and 4-vert modes is supported. Let me know how it works; I haven't tested it very thoroughly....


- alex25 - 03-05-2009

joevenzon Wrote:The 3-vert mode is in R76. Auto-tracing for 2, 3, and 4-vert modes is supported. Let me know how it works; I haven't tested it very thoroughly....
seems to work but the new roads.txt is almost identical to the old one (i just updated ring2007). puzzled...

--alex--


- joevenzon - 03-05-2009

I had a look at the new roads.trk file and it seems different in the way I would expect -- mainly that lines 2, 3, 6, 7, 10, 11, 14, 15 are the same (and their values are due to new third point you put in).