Animated planet - can't get texture to line up

Nov 24, 2008 at 8:17 PM
Edited Nov 24, 2008 at 8:20 PM

I'm trying to animate a planet. I'm using a "mural" generated by FlamePear's LunarCell program (www.flamingpear.com).  I use the sample sphere that is located in the source code and I apply a texture to it instead of a color.

I seem to be running out of room on my sphere, so the entire PNG of the mural isn't being mapped to it. I've tried different sizes and nothing seems to map all the way around.

Would someone care to give me a quick and dirty rundown of the concepts of what's going on when I map a texture?

Here's a description from the FlamingPear help file in case it helps:

LunarCell can create flat maps that you can use as texture maps in a 3D animation program.

The maps are drawn in a cylindrical equirectangular projection, also known as cylindrical equidistant or plate carée: meridians are vertical, parallels are horizontal, and all are uniformly spaced. The map will fill the entire selection rectangle, permitting super-high resolution. For proper results you should start with a selection exactly twice as wide as it is tall.



Ryan

Nov 24, 2008 at 8:34 PM
Sorry for replying to my own thread... here's sample code:

http://game.forgottenplanets.com/planettest.web.zip

You should be able to unzip it and get it working. I've got the image url hard coded for simplicity, so may have to change that. Look on line 70 of Page.xaml.cs to see the url...
Nov 25, 2008 at 7:03 PM
In Planet.cs on line 40, you are initializing the brush to the wrong image size.  I changed it to

Kit3DBrush kb = new Kit3DBrush(imgBrush, 400, 200);

and it seems to be very happy indeed.  Looks good!

Hope this helps,

Tim
Nov 25, 2008 at 10:30 PM
DOH! I can't believe I missed that. It seems I was trying to make something simple seem way complex and didn't even think to look there...

Thanks for the good catch!

Ryan
Nov 25, 2008 at 10:57 PM
You're welcome.  Don't be so hard on yourself - everyone could use a second set of eyes periodically.  Maybe someday you'll help me out ;-)

Tim