Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
trk importer/exporter
05-16-2010, 04:07 PM,
#1
trk importer/exporter
I wrote a simple(stupid) trk importer and exporter. They are meant to be used to adjust the bezier surface control points manually.

Import jpk + import trk (ring2007):
[Image: ring0syvmb.jpg]

The bezier surface is the active(pink) mesh in the above screenshot. It's control points(vertices) need to be adjusted to cover the track mesh. Right now the are intersecting it(lie below the track mesh).

Volunteers are welcome. Smile
Download: http://svn.vdrift.net/viewvc.cgi/trunk/t...VDrift+Art
Reply
05-16-2010, 05:29 PM,
#2
 
this is a bug in the current implementation. joe promised to fix it but nothing has happened yet. i'll take a look at what you did. thanks.

--alex--
Reply
05-16-2010, 05:52 PM,
#3
 
I fixed the Karussell:
[Image: t8365sp.jpg]
[Image: fixedb94ub.jpg]

Schwalbenschwanz needs to be adjusted too I think.
Reply
05-16-2010, 06:06 PM,
#4
 
your import script assumes that we are in 2-vertex mode selection. if you look at that part of the track in the track editor you'll see it was done using 4-vertex mode selection. are you sure your script works for that case as well? if we fix the track editor i can redo the track really fast. even better a converter would be nice, that takes the old bezier surface and then corrects it.

--alex--
Reply
05-16-2010, 06:13 PM,
#5
 
I converted it back to be able to see all patch segments. This 4-vertex mode is setting the middle control points to one value(compare roads.trk r360 vs r539). It's like taking 4 control points of a bezier and merging point 1 and 2.

The importer script simply reads the control points and creates a mesh. In the end every patch has to consist of 16 points.
Reply
05-16-2010, 06:18 PM,
#6
 
how does the track editor know when you are in different vertex selection modes? something has to be different between them otherwise the track editor will render the patches the same (which it doesn't).

--alex--
Reply
05-16-2010, 06:18 PM,
#7
 
Quote:merging point 1 and 2
I guess this is how Joe tried to add support for road buckles.
Reply
05-16-2010, 06:20 PM,
#8
 
Quote:which it doesn't
I don't know what the track editor renders. But there are always 16 points per patch. This is how it is defined.
Reply
05-16-2010, 06:27 PM,
#9
 
By the way. I've found a nice applet to get a feeling for the control points.
http://www.cs.princeton.edu/~min/cs426/c...ezier.html

Create four points and move them around to see what happens.
Reply
05-16-2010, 06:32 PM,
#10
 
that's exactly what i'm saying. there has to be extra information in there which you are not aware of. the track editor renders the points i selected when i made the track. this is not the case any more, now everything is rendered in 2-vertex selection mode. please restore the previous version or i'll do it. i worked hard to make that track, don't fuck it up.

--alex--
Reply
05-16-2010, 06:34 PM,
#11
 
Wait a moment. In the 4-vertex selection mode you are setting the corner(0, 3) and the middle points(1, 2). The problem is that the surface won't go through points 1, 2.

Feel free restore the previous version.
Reply
05-16-2010, 06:42 PM,
#12
 
NaN Wrote:Wait a moment. In the 4-vertex selection mode you are setting the corner(0, 3) and the middle points(1, 2). The problem is that the surface won't go through points 1, 2.

did you look at the code in the track editor? anyway, this was discussed in this thread http://vdrift.net/Forum/viewtopic.php?t=975

Quote:Feel free restore the previous version.
done.

--alex--
Reply
05-16-2010, 06:57 PM,
#13
 
I think the best way would be to use three points(2 corners + 1 center) and force the bezier to pass through them(calculate the control points 1,2 from the center point).

Edit:
I think I can write a script to do this.
Reply
05-17-2010, 11:34 AM,
#14
 
So, my original solution was to make the track editor allow you to assign the intermediate control points (1 and 2: either assigning them both to the same point (in 3-vert mode), or to different points (in 4-vert mode)), but that didn't quite produce the results desired. It'd be nice if you fixed this so that the control points get moved so that the surface goes through the intermediate point(s) selected, however in addition: There are tracks (like that part of the nurburgring) where the different parts of the road are meant to be discontinuous left-to-right, so instead of manipulating control points in a bezier, there should really be more than one bezier. I was thinking I'd add support for that when I eventually rewrote the track editor, but who knows when that will happen, so feel free to implement this if you think of a good way to do it.
Reply
05-17-2010, 12:31 PM,
#15
 
Quote:control points get moved so that the surface goes through the intermediate point(s)
I've been thinking about doing it in VDrift at load time. Don't want to touch the trk files. alex25 is kinda sensitive regarding this.

Quote:when I eventually rewrote the track editor
My grand plan is to implement the track editor functionality in a blender plugin. For my very personal use, haha.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)