In a private communication, a subscriber to the Hayden's "Universe" mailing list mentioned
I haven't figured out how to put a texture on a 3D object yet. When you figure that out, please let me know! I would love to be able to flyby some cool planets with NASA texture maps on them.
I decided this would be a reasonable project to help learn how to display information within Partiview. Here's my initial try at answering this request.
Planets v0.21 improves on Planets v0.1 by including a cloud layer and specularity.
Archive: PLANETS_V021.ZIP Length Date Time Name -------- ---- ---- ---- 1687 02-10-04 21:21 planets-512-readme.txt 37 02-08-04 11:20 planets.bat 0 02-07-04 09:22 data/planets/ 0 02-07-04 09:22 data/planets/images/ 237567 02-10-04 21:16 data/planets/images/earth-512.sgi 483544 02-10-04 21:03 data/planets/images/earth-clouds-512.sgi 395198 02-10-04 21:07 data/planets/images/jupiter-512.sgi 393728 02-10-04 21:12 data/planets/images/mars-512.sgi 0 02-07-04 09:22 data/planets/models/ 76654 02-08-04 00:47 data/planets/models/sphere1.obj 76886 02-09-04 18:58 data/planets/models/sphere1c.obj 1473 02-10-04 21:14 data/planets/planets.cf -------- ------- 1666774 12 files
Planets v0.25 has improved resolution. The models have 16x as many facets, and the images have 16x as many pixels as those in v0.21. This is at the cost of increasing disk usage from 1.7MB to 25MB.
Archive: PLANETS_V025.ZIP Length Date Time Name -------- ---- ---- ---- 37 02-08-04 11:20 planets.bat 0 02-07-04 09:22 data/planets/ 0 02-07-04 09:22 data/planets/images/ 3321287 02-10-04 19:49 data/planets/images/earth2k.sgi 7190948 02-10-04 20:32 data/planets/images/earth-clouds2k.sgi 5480836 02-10-04 19:28 data/planets/images/jupiter2k.sgi 6291968 02-10-04 18:36 data/planets/images/mars2k.sgi 0 02-07-04 09:22 data/planets/models/ 1466728 02-10-04 05:54 data/planets/models/sphere2.obj 1468334 02-10-04 05:56 data/planets/models/sphere2c.obj 1523 02-10-04 20:40 data/planets/planets.cf 1938 02-10-04 21:23 planets-2k-readme.txt -------- ------- 25223599 12 files
These are the start of an attempt to make planets visible within Partiview. Development was done on a system running Windows XP Pro, SP1. It should be straight forward to translate the .BAT file into an appropriate shell script for Unix or Linux.
This demo projects simple cylindrical (aka "Plate Carée") surface texture maps onto a Wavefront .OBJ model which roughly approximates a sphere. This "spherical" object could be replaced by one with more facets and thus a smoother surface at the cost of having a much larger file that takes longer to load.
Planets v0.21 includes low resolution, 512x256, surface map images of the Earth, Earth Clouds, Mars and Jupiter . I used ImageMagick to convert public domain JPEG surface texture maps into the SGI image format that Partiview uses. Planets v0.25 replace these images by higher resolution, 2048x1024 versions.
Both of these versions of Planets position all three planets at or near the origin of Partiview's World coordinate system. Each planet is defined as a separate group, though, so you can select the one you want to see.
![]() Mars |
![]() Cloudy Earth (planets v0.25) |
The "thumbnail" images above link to much larger pictures. |
Planets v0.21 and v0.25 improve on v0.1 by including specularity in the cloud layer for the Earth. Partiview's default white surface texture is modified by specifying a cloud texture image as an Alpha channel. That texture image includes its own Alpha channel. In combination with an "rgb" declaration, this seems to cause Partiview to display specularity on the planet's surface image. I have not the slightest idea why.
In Planets v0.21, the 512x256 surface textures are projected
onto sphere1.obj
, which has 32 sections and 16 layers.
The Cloud texture is projected
onto sphere1c.obj
, which is identical
to sphere1.obj
except that it has a diameter of 101 units
instead of only 100.
In Planets v0.25, the 2048x1024 planet surface textures are projected
onto sphere2.obj
, which has 128 sections and 64 layers.
The Cloud texture is projected
onto sphere2c.obj
, which is identical
to sphere2.obj
except that it has a diameter of 101 units
instead of only 100.
In the process of creating this, I discovered that Partiview seems to have some bugs related to clipping, which affects the textures projected onto Wavefront objects. As best I can tell, the code that implements the bounds speciried in the "clip" directive causes very strange visual effects as the object approaches the more distant clipping boundary: the surface texture becomes partially transparent.
![]() clipping bug |
Partiview displaying a clipping bug. The far side of the Earth (Africa and Madagascar) is visible through the near side of the Earth (the south Pacific, including Australia and the western rim of South America). If you look closely, you'll notice that Africa is reversed. The section of the surface texture image that's projected onto the far side of the glob is seen from its "underside". |
This error can be seen by selecting the Earth "group" and using the RighMouseButton to slowly move away from it. As the image of the Earth approaches the far clipping plane, some rather strange effects will be seen, long before the planet is entirely clipped and no longer visible.
A related problem can be seen if the arguments to the "clip" directive
are modified. The code used in planets.cf
is
eval clip 0.1 1000
eval clip 0.001 1.0e6
![]() clipping bug: second example |
Partiview displaying a clipping bug. The far side of the Earth (southern South America) is visible through the near side (the Indian Ocean). |
While learning how to add a layer of clouds, I discovered that the objects declared in the .cf sometimes are not placed in exactly the same location. Since no position is specified for any of them, I assumed the objects all would be centered precisely at [0,0,0].
![]() Jupiter offset from its clouds |
Unfortunately, this seems not to be the case. Although the transparent EarthCloud layer defined as group 2 seems to properly surround the Earth, the JupiterCloud layer defined as group 6 obviouly is not centered at the same location as Jupiter, group 5. The clouds can be seen on only one side of the planet. |
At least some of the time objects seem to be drawn in the
opposite order from which they're listed in the .cf
file rather than being depth sorted.
This problem can be reproduced by selecting group 2 (EarthClouds) and group3 (Mars). Although the EarthCloud object specified as group 2 is partially transparent, it completely obscures the opaque Mars object, group 3, instead of being drawn around it.
When only groups 3 and 4 are selected, the expected image is drawn. MarsCloud layer defined as group 4, which otherwise is identical to group 2, is drawn around Mars.
Another problem encountered was that the cloud layer object did not
properly display clouds above the surface of the associated opaque
object unless its model object (sphere1c.obj
) was made significantly
larger than the enclosed object. The models have exactly the same
shape, so I had hoped to place the cloud layer at a height comparable
to real clouds. Unfortunately, when I created a model with a diameter
of 100.1 units, the cluds weren't drawn properly. The diameter had to
be increased to 101 units instead.
My current guess is that this problem actually is related to the positioning problem seen with the clouds associated with Jupiter. The models are not all being positioned exactly at [0,0,0].
This archive is obsolete. Download v0.21 or v0.25 (above) instead.
Archive: PLANETS.ZIP Length Date Time Name -------- ---- ---- ---- 0 02-07-04 09:22 data/planets/ 0 02-07-04 09:22 data/planets/images/ 292156 02-08-04 12:19 data/planets/images/earth.sgi 395967 02-08-04 12:19 data/planets/images/jupiter.sgi 400506 02-08-04 12:19 data/planets/images/mars.sgi 0 02-07-04 09:22 data/planets/models/ 76654 02-08-04 00:47 data/planets/models/sphere1.obj 960 02-09-04 17:30 data/planets/planets.cf 37 02-08-04 11:20 planets.bat 745 02-08-04 12:35 planets-readme.txt -------- ------- 1167025 10 files
planets.cf was updated on 9Feb to fix a typo.
The Earth surface and EarthCloud textures were created from TIFF images provided on the Web by NASA at http://earthobservatory.nasa.gov/Newsroom/BlueMarble/
The Mars surface texture was created from a TIFF image derived from Viking images and provided on the Web by the USGS at http://pdsmaps.wr.usgs.gov/maps.html
The Jupiter surface texture was created by scaling and merging the polar regions of a low-resolution public domain jpeg image with the higher resolution TIFF equatorial map provided on the Web by LPL at http://ciclops.lpl.arizona.edu/PR/2000L25/PR2000L25A.html
If you don't tell me that something's missing, unclear or wrong, I can't improve it.