TEXMAP SPHERICAL


TEXMAP SPHERICAL
#1
While working on VEX parts (I know, boo; hiss, that's not LEGO) Smile, I finally had a real-world reason to map spherically.

The HEXBUG folks have a VEX IQ compatible set called Orbit, which is a built-it-yourself Orrery, and it includes three spheres that would need the texture mapping treatment (our Sun, the Earth and its moon).

I have mapped the latter two.

Congratulations, Roland. This was easy for me to get working, and it looks fantastic in LDCad!

[I did a half-mapping of each half-sphere, top and bottom -- was able to use the same image in either case, didn't have to slice or dice that at all]

-- joshua


Attached Files Thumbnail(s)
   
Reply
Re: TEXMAP SPHERICAL
#2
Joshua Delahunty Wrote:Congratulations, Roland. This was easy for me to get working, and it looks fantastic in LDCad!

[I did a half-mapping of each half-sphere, top and bottom -- was able to use the same image in either case, didn't have to slice or dice that at all]
Thanks,

The current implementation in LDCad uses a hack to make full sphere mapping possible as the literal spec will cause problems past 180 degree. So I'm using longitude / latitude mapping to generate the texture coordinates to get around that. It's an optional (currently enabled) feature though as I wasn't sure the spec was intended to support >180 deg (by limiting this on the authoring side.)

Also there will still be problems at the poles when using certain orientations of the texture (resulting from misalignment of vertices).
Reply
Re: TEXMAP SPHERICAL
#3
Roland Melkert Wrote:
Joshua Delahunty Wrote:Congratulations, Roland. This was easy for me to get working, and it looks fantastic in LDCad!

[I did a half-mapping of each half-sphere, top and bottom -- was able to use the same image in either case, didn't have to slice or dice that at all]
Thanks,

The current implementation in LDCad uses a hack to make full sphere mapping possible as the literal spec will cause problems past 180 degree. So I'm using longitude / latitude mapping to generate the texture coordinates to get around that. It's an optional (currently enabled) feature though as I wasn't sure the spec was intended to support >180 deg (by limiting this on the authoring side.)

Also there will still be problems at the poles when using certain orientations of the texture (resulting from misalignment of vertices).

The original PLANAR work came straight from the OpenGL docs as a suggestion for this type of mapping.

The CYLINDRICAL and SPHERICAL specs were from the same book. We opted to try to make it as easy to implement as possible. I never figured it would take so many years, though Sad It was MEANT to be really straightforward (create a set of U-Vs, the style would just change how they were calculated, the main loop should not have had to change much).

I actually only used half-and-half because it's what I hit on first that worked (model a half-sphere, get it texmapped, move on), I'm glad I didn't spend a bunch of time trying to use only one TEXMAP statement. Smile

I'm talking to the author of Foundry (our reference platform) to try to get those implemented in there, and it looks like I'll be the one to patch LDView soon (with some pointers from Travis) -- I may be the Foundry programmer on this one too. I've asked Leo to consider them for LeoCAD. That only leaves BrickSmith as a concern right now, as I can't imagine doing this in software for MLCAD. Sad

-- joshua
Reply
Re: TEXMAP SPHERICAL
#4
Yikes, just realized you already did the "earth thing". Here's a broader perspective...

-- joshua


Attached Files Thumbnail(s)
   
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)