In the previous post I showed a step to create a “rounded” cube. But the 4-engine cargo ship of my second post, the one where I've introduced the argument of raytracing with POV Ray, use the superellipsoid. Here it is:
You can see it is very smooth. The actual smoothness of the edges depends on the parameters, value_E
(east-west) and value_N
(north-south), as you can read in the documentation.
To produce that image, it was simply as
superellipsoid
{
<.1,.1>
texture { BasicTex }
scale 6
rotate y*54
}
We'll see something about texture
soon or later in future posts. For now, it is a generic basic texture we don't need to talk about.
This very simple object is a part of the ship, allegedly it contains all the cool technology of the engine and its “fuel”, whatever it is; we don't know really, but I can say you that it isn't the dilithium, in fact this kind of ship is used to move few goods (and also personnels) from a space station to the surface of a planet (with a proper landing platform), or a lot of goods from a space station to another in the same star system.
Let's remember how it looks when the ship (without extra-cargo bays) is landing on a platform on the surface of a dull planet. It can happen for maintenance reasons, to exchange personnel according to shifts, and to unload/load goods.
In this image a human would be very small. If you take as reference the “door” of the checkered corridor, don't be fooled: it's not a home door indeed! It is the main entrance of a sort of hangar. In the half-sphere labeled as cockpit, only a small part is the real cockpit (it isn't transparent because pilots don't need eyes: there are sensors, radars, and a tough computer helps you).
If you're wondering, the ship perches on the cones which are another part of the engine and their role is also to give something the ship can perch on when landing. This ship needs a platform.
The making of the cone of the engine isn't thrilling for its shape: it's a cone! To be exact, there are 2 cones!
One, is the external one, and it's a open cone (no caps). The other is a inner cone, but we don't want it to be a real shape: we need it to define a volume where some magic happens. This “magic” is the fire (which is not a fire, but it looks so…) of the engine when it's on.
To achieve the result the inner cone is hollow, and it “fictitious“ color is a totally transparent white… That is, there's nothing “solid” to obstruct the passage of any rays. As said, its only role is to border a volume, and inside this volume it happens that…
Interiors and media
The texture of an object describes the surface properties of an object. I've used a basic texture to show you the shapes I'm building. You don't see through the surfaces of those shapes, and you can't see what's inside. From the raytracer point of view, it means that no rays go beyond that surface, so its only concern is how those rays are reflected. In the image of the landing there's a case of transparent surface, it's the dome of the building. In that case, the raytracer must compute how the rays refract and reflect.
The rays come from (at least) one light source and usually interact only with surfaces and transparent surfaces or transparent solid objects, when the refraction happens. If we want to create a realistic scene, simulating what happens to photons also through a medium like the air, we need more computational power. POV Ray has the media to do that: we could fill our scene with air! It's very cool… but indeed you shall refrain from adding air in your HD scene, lest it will take forever to be computed, unless you have a suitable hardware (not my case, alas).
- Examples of emitting, scattering and absorption media
- Here other examples which make also clear why we need it.
In our case, the media is “contained by an object” (our hollow cone), and it emits, because there is happening something strange with ions, excited energy levels of some kind of atoms… I don't know the details, so don't ask! The only thing I know, it's that you can see red spots when the ship is landing.
It's finction, but it's also real: those red spots aren't drew on the surface of the platform. Instead, they are the result of something which emits a red-ish light.
In my original scene, the union between the external open cone and the internal hollow, media filled cone is called FirePlace
. If you are behind such an engine when it is on, you will see this:
Scary, isn't it? I suggest you stay far far far from it.
Now, we've finished: let's make an union between our superellipsoid and the cone on fire.
Note: there's a light in the scene, and in fact you can see that the superellipsoid casts a shadow on the cone. Moreover, since I am using basic textures (except for the fire place now!), I had to adjust the colors so that it was clear where the cone is clasped to the superellipsoid.
Now we have our engine. In the next episode, we'll have four of them, the central body of the ship and then something to keep everything altogether.
Details
This is the code for our engine section, made of the fire place and our superellipsoid. You must scale, rotate and translate it according to your needs. There's a lot I haven't explained. But you get the idea and if you want to learn more about POV Ray, I've already given pointers to resources.
#declare FirePlace = union {
cone {
-.5*x, .1
.5*x, .8
open
texture { FirePlaceTex }
}
cone {
-.49*x, .1
.5*x, .795
hollow
pigment { rgbf 1 }
interior {
media {
emission <1,.8,.79>*10
absorption .4
density {
bozo
color_map {
[0.0 color rgb <1,0,0>]
[0.3 color rgb <.8,0,0>]
[0.7 color rgb <.4,0,0>]
[0.77 color rgb <1,.05,0>]
[1.0 color rgb <.99,0,0>]
}
turbulence 6
}
}
}
}
}
#declare EngineSection =
union {
superellipsoid { <.1,.1>
texture { BasicTex }
}
object { FirePlace translate x*1.3 }
}
You will use it something like this:
object {
EngineSection
scale 5
}