05-14-2010, 11:37 AM,
|
|
zimluura
Senior Member
|
Posts: 286
Threads: 22
Joined: Oct 2007
|
|
i got some normals. at least semi-work-able ones. been sorta puzzling on how to get them all calculated correctly and quickly. i'll commit it today so they look pass-able for the time being.
the wheel_edge was going to fill that blank space. i think it will need to be another autogen mesh, that way it can use the wheel.joe texture (a strip at the bottom of the texture seems like a work-able idea). and always have the same number of segments as the tire. and hopefully tie them together nicely.
after i get the normal directions sorted out, should i bother the cpu to get them normalized? i haven't heard of a lighting model that uses their magnitude, but that doesn't mean it doesn't exist
and is, there any way to alter a shader to have it draw vertex normals extending like little hairs off the vertex?
|
|
05-14-2010, 04:22 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Quote:should i bother the cpu to get them normalized
A lot of lighting models are using dot/cross products with the surface normal so normalizing it is a good idea. The speed shouldn't be an issue. We are not going to generate wheels per frame.
Quote:any way to alter a shader to have it draw vertex normals extending like little hairs off the vertex
Write your mesh into a file(you can use std::cerr) in obj file format and check it in blender. It's really simple.
obj file format (from wikipedia):
Code: # this is a comment
# List of Vertices, with (x,y,z) coordinates.
v 0.123 0.234 0.345
v ...
...
#Texture coordinates, in (u,v) coordinates.
vt 0.500 -1.352
vt ...
...
#Normals in (x,y,z) form; normals might not be unit.
vn 0.707 0.000 0.707
vn ...
..
#Each face is given by a set of three indices each to the vertex/texture/normal
#coordinate array that precedes this.
#Hence f 1/1/1 2/2/2 3/3/3 is a triangle having texture coordinates and
#normals for those 3 vertices,
#and having for the vertex 1 (1/1/1) the vertex 1 from the "v" list, texture coordinate 1 from
#the "vt" list, and the normal 1 from the "vn" list; then for the 2nd vertex:
#the vertex 2 from the "v" list, texture coordinate 2 from
#the "vt" list, and the normal 2 from the "vn" list; for the 3rd vertex:
#vertex 3 from the "v" list, texture coordinate 3 from
#the "vt" list, and the normal 3 from the "vn" list
#NOTE: The list of vertices, etc. is one-based-indexing (meaning the first vertex in the file is v1).
f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3
f ...
|
|
05-18-2010, 09:08 AM,
|
|
zimluura
Senior Member
|
Posts: 286
Threads: 22
Joined: Oct 2007
|
|
adapted the test app to use a 3d only skeleton that looks like vdrift's mathvector.
tire normals should be good now. updated visual demo here
http://sites.google.com/site/zimluuraprojects/code
will start on the wheel_edge soon.
|
|
05-20-2010, 12:58 PM,
|
|
zimluura
Senior Member
|
Posts: 286
Threads: 22
Joined: Oct 2007
|
|
got a few questions that you guys might be able to help me out on.
first one is artistic vs. performance: pondering 4 different designs for wheel edges.
first image here
http://sites.google.com/site/zimluuraprojects/vdrift
A will look ok from common view angles
B will look ok from all angles
C will look good from common angles
D will look the best from all angles
poly and vertex counts mostly go up proportionally as the letter approaches D. lots of vertexes will need doubles because we'll likely want somewhat hard angled lighting. i think B and C might have the same vert/poly load.
with 32 segments the tire is 264 verts and 448 triangles. so i'm guessing option D will be somewhere around that number.
second is artistic vs. complexity. since the wheel edge is mostly a sort of lip. should i include tweak-able parameters for making it bevel inwards and another parameter for how thick a wheel is? i think i'm in favor of this, but if it makes wheels too difficult to define then maybe not.
third question is a technical one about tires. does the measurement of the wheel_width equal the tire's section width?
|
|
05-21-2010, 03:30 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
A and C will be a problem with open-wheel cars(f1,...). I would go for B or D. We could fake the lip(flange) thickness using a normal map if we had some.
Quote:third question is a technical one about tires. does the measurement of the wheel_width equal the tire's section width?
I found this one:
A P205/60R15 has an approved rim width range from 5.5" to 7.5". http://www.tirerack.com/tires/tiretech/t...widthrange
|
|
05-25-2010, 08:29 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Quote:i wasn't thinking about doing an inside circle to cap the cylinder
I would go for a capped cylinder. I don't think we are going to lose fps because of this.
Maybe the brake disks should go in a separate mesh/drawable to be able to let them glow?
Cars with drum brakes or other stuff will have to provide custom meshes that override the default disc brakes.
|
|
|