LDraw.org Discussion Forums

Full Version: [LDPartEditor] First Alpha Version News (until 2014-09-19)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11
I only made planar projection parts, since this is the only projection supported by LDView (and the most useful I think, since to acquire images of real parts, you generally use a photo... planar!).
For examples, see http://forums.ldraw.org/showthread.php?t...58#pid9858 and http://forums.ldraw.org/showthread.php?t...21#pid7921
Thanks,

As for the types: for normal up front pictures planar would be fine indeed, cause the source picture automatically includes the projection stretch needed.

But when working with (official) Lego stickers you probably need to use the cylinder and or sphere to account for projection stretching/shrinking when the target area is (very) curved.
Thanks! The attached pictures are the checker-board texture UV-mapped to a sphere using typical sphere-mapping from a 3-d modeler.

The left sphere is made from a small number of segments, the right a much larger number. Since the UV map is per vertex you can see the 'sphere' lines aren't well-projected on the left.

The 3-d modeler can get the caps right because for each vertex it knows the connectivity to neighboring vertices; a straight vertex->uv function is going to introduce discontinuities or wrap-around and possibly undefined results at the poles.

So theoretically if you have your triangles in advance and you are applying a mapping function to each one to pre-compute UV, you could 'solve' the poles with some analysis. I don't think you can do this in shader without geometry shaders and a ton of work.

I'm not a fan of using projection for part textures at all - the rest of the modeling world uses UV mapping, which makes the projection of parts, management of discontinuities, and other complex issues not the problem of the file format and every client that reads it.
Good point for stickers on cylinder! More doubtful on sphere ;-)
I found a "solution" here, but this would extend the current TEXMAP specification and assumes that every geometry placed around the polar caps is a triangle.
On the one hand, there is loss of texture information near the caps, since you can't project every point from the 2D image on the sphere.
On the other hand, it is impossible to find a solution for surfaces which are streched across the caps.

How do we proceed now?
Nils Schmidt Wrote:How do we proceed now?

I'm not sure it's even supposed to be perfect, the initial spec (to me) doesn't seem to be targeted at enclosed objects anyway. Maybe it's just a case of the library manager (Chris Dee) setting some authoring ground rules.
Ben Supnik Wrote:I'm not a fan of using projection for part textures at all - the rest of the modeling world uses UV mapping, which makes the projection of parts, management of discontinuities, and other complex issues not the problem of the file format and every client that reads it.

The spec was adapted on a 'as is' basis, mainly because it's (authoring) user friendless and the wishes of the spec author(s). I was not too happy with this but I believe most were happy with it. It's a bit disappointing there no real parts (except the one helmet) made to really test the spec yet though.

On the other hand we probably could extend the extension by adding a special meta line supplying hard coded uv cords for the next type 3 or 4 line in a file, e.g.

!TEXMAP UV NEXT 0.0 0.0 1.0 0.0 1.0 1.0 0.0 1.0
0 !: 4 16 ..........

to solve the really complicated authoring needs, but then again I'm not completely sure it was supposed to be used on enclosed objects anyway.
Seems ok to me, very nice.
I am very busy right now.
Here is a new video on youtube which says more than 1000 words.
https://www.youtube.com/watch?v=S_6hx10kwZU
Pages: 1 2 3 4 5 6 7 8 9 10 11