The Placeholder trick
Sometimes it is desirable to cut a model into several separate parts and reassemble them in Celestia. For example if you want to animate a part of it., or perhaps to make a part emissive.
To make this work, we use a placeholder model that will be the models focus
A common side-effect of doing this is that your model becomes unselectable
You may also experience ugly depht-sorting issues. Due to CelestiaÃƒâ€šÃ‚Â´s limitations there are no
absolute respite from this, but there are ways to minimize these problems. So, here is my
optimal recipe for getting the placeholder trick to work in an elegant way.
For the purpose of this minitutorial, we will create a rocket with a glowing tail... So,
in your 3D editor, you create a simple model consisting of three distinct meshes:
A. The rocket mesh
B. The exhaust mesh
C. The Placeholder mesh
First, we construct A. A simple cylinder with a cone on top will suffice.
For B, you just invert the cone, assign a semi-transparent material to it and map your
favourite PNG file of a fire onto that material.
C will be a cube that encloses A and B completely. You make a 100% transparent material
for C, so that it will be completely invisible.
Now you have a model that looks something like this:
Next, you save this model as three separate 3DS files:
Delete the exhaust mesh (B) and export to "rocket.3ds"
Retrieve the exhaust mesh (B) from memory and delete the rocket mesh [A] instead, then
export to "exhaust.3ds"
Now comes the trick: you do NOT delete A and B to export the placeholder cube. Rather,
you copy C into a new model file and save it. Some more work must be done with it without
disturbing the A-B-C setup.
HereÃƒâ€šÃ‚Â´s what you do with the new copy of C:
1. Create a 100% transparent PNG file that is 32x32 pixels at 72 dpi (or any power of two,
but the smaller the better). Save it as "placeholder.png"
2. In your 3D modeller (in your new C file), assign the PNG file to the transparent material
of the cube, and edit the material so that it is no longer 100% transparent. Set it to 50%
opaque! Now it is not only transparent, but the PNG file is ALSO transparent as a material
not just as an image
4. Export the C model to "placeholder.3ds"
HereÃƒâ€šÃ‚Â´s why you make the transparent material in such an elaborate way:
Celestia will simply disregard 100% transparent meshes. It will know it is there so that the
models align properly, but it will NOT let you select invisible geometry. Which means the
transparent parts of model A and B becomes impossible to grab with your cursor in Celestia.
By introducing the transparent PNG file, Celestia does not KNOW the third model is transparent,
and so the placeholder mesh becomes selectable. Which is essential for assembling the model
in the SSC file:
The SSC file
1. Create an empty text file and save it as "rocket.ssc"
Now, the placeholder goes FIRST, at the very top of the document. This is because Celestia
draws objects in the order it reads them, and we want the placeholder mesh to be read first.
That way, your cursor will always grab the invisible cube rather than one of the visible parts
inside it. It makes your model selectable
# -- START ROCKET ------------------------------------------
# The placeholder comes first, and gets the name of the rocket
# The semi-transparent exhaust comes BEFORE the opaque mesh,
# to minimize the appearance of CelestiaÃƒâ€šÃ‚Â´s depht-sorting bug
# The opaque part(s) comes after any transparent parts
# -- END ROCKET ------------------------------------------
NOTE: if you have many transparent meshes, you should esperiment with their order in the SSC
file until you find the optimal setup. Celestia will treat them all differently, so it can only be resolved by eye.
NOTE 2: Why you should not make the C cube in your A+B+C file the placeholder:
You can if you want to. But there is a couple of reasons why not:
A) If you make the placeholder once
, you can use it with all
B) If you do this inside your mesh files, they will interfere the day you want to use a given mesh
for something else, since the PNG version of C will make it impossible to select the actual mesh
inside when in Celestia
. Usually this is the desired behaviour... But not neccecarily in all future
possible ways you want to use your model.