Forums

Full Version: procedural tires modification
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hey guys. i recall a few months back someone was asking how to use just a mesh as a tire instead of the procedural ones that generate from a tire code. i've been sortof mulling this idea over.

since, when a tire is generated from the tire code, all the tire code stuff is at the front of the function (and then the rest is a massive amount of vertex, triangle and normal calculation), it may be fairly easy to de-couple that and make two front ends for the function. one that takes a tire code and one that takes raw floating point values and lets you make a tire of any proportions you like (so long as it has the same basic structure of vertex rings).

would this be a good thing to invest time in? or should i just bank on any tire that doesn't have a code being so irregular that a different front-end can't fix it, and they'll just need a mesh.
Custom wheel mesh support is broken. I've got two patches to deal with this issue, but haven't decided which one to go with. Both support custom meshes for tires/wheels/brake rotor.

The first one moves mesh gen into model manager. Car loader expects a mesh, doesn't care if it is generated.
Code:
[wheel.rl.tire]
texture = tire/touring.png
mesh = tire/355/46/13
size = 355, 46, 13
type = &tire_rear

[wheel.rl]
texture = oem_wheel.png
mesh = rim/oem_wheel.joe/355/46/13
position = -0.71, -1.53, -0.37
camber = -0.50
caster = 0.28
toe = 0

The second makes mesh gen explicit.
Code:
# dynamic mesh generation
[meshgen.tire]
name = T355/46/13
section-width = 0.355
aspect-ratio = 0.46
rim-diameter = 0.33
#tread-width = 0.75 * section-width
#tread-radius = section-width * aspect-ratio + rim-diameter / 2.0
#inner-width = tread-width
#inner-radius = 1.08 * rim-diameter / 2.0
#sidewall-bulge = inner-width * 0.05;
#shoulder-bulge = tread-width * 0.05;
#sidewall-radius = section-width * aspect-ratio / 2.0 + rim-diameter / 2.0
#shoulder-radius = section-width * aspect-ratio / 1.1 + rim-diameter / 2.0
#segments = 32

[meshgen.rim]
name = R355/46/13
section-width = 0.355
aspect-ratio = 0.46
rim-diameter = 0.33
rim-mesh = oem_wheel.joe
#flange-displacement = 0.01
#flange-outside-width = 0.75 * section-width
#flange-outer-radius = 1.08 * rim-diameter / 2.0
#inner-width = flange-outside-width - flange-displacement * 2.0
#inner-radius = rim-diameter / 2.0 - 0.01
#segments = 32

#[meshgen.disk]
#name = D200
#diameter = 0.2
#thickness = 0.03
#segments = 32

[wheel.rl.tire]
type = &tire_rear
texture = tire/touring.png
mesh = T355/46/13

[wheel.rl.rim]
texture = oem_wheel.png
mesh = R355/46/13

Issue: https://github.com/VDrift/vdrift/issues/20