Modelling and animating a solar system using Real3D v3.5
Introduction
Release note:
As the first issue on this was first released as a zipped file, some
references to files will no apply. I have not had the time to go
through this whole tutorial again, so if you find such a reference,
please email me at
kpetter@c2i.net, and I will mail you any missing
files by hand. This is the first tutorial I wrote, so it isn't
all that good. Also, this tutorial is not scientific accurate,
to say the least.
Aim:
This small tutorial will guide you through the steps needed to create
a planet orbiting a star, which also contains a moon orbiting the
planet. When done you will have learned how to create faked sharp
terminators on planets (as the current release of Real 3D does not
support it directly), control object by different animation methods,
and some basic use of skeletons to control the objects. Also, a way
of producing faked 'radiosity' (actually albedo value) will be shown.
Who is it for:
It is best if you have a little experience with Real3D before going on with
this. At least the understanding of the hierarchical way Real 3D works, and
some basic understanding of the Real 3D standard user interface is required.
You don't have to be an expert though, as most things are explained.
However, some things have been left out, to encourage you to study the manual...
(good excuse, huh?) maybe even come up with better ways of doing this.
Features:
- The orbits are animated using PATH methods. Additional ROTATION methods to
rotate the bodies.
- Relative and correct scale ratios are presented, but have been overridden
for better visualization.
- Animated (autopoint type) 'radiosity', to make the earth light up unlit parts
of the moon, and vice versa.
- Animated (autopoint type) transparancy map, so the light can shine through
the surface of the earth, still casting full shadows.
- Simple texture maps; earthcol.iff, mooncol.iff, transpmap.iff. Kept small,
find better maps somewhere on the web.
- Full eclipses and partial eclipses will/can happen at some point in the animation,
depending on time scale.
Modelling time, and some easy animating
Preperations:
- Start Real3D with no default lights, no materials, and no objects (or hit
'File/Project/New', and delete the materials).
- The default 0.1 meter sized grid will work fine.
- It might also be a good idea to set 'Settings/Creation/Qry. Level Name' since
we for all levels will have appropriate names.
- Be sure that the RPL-script is in the macros directory, and you might test
it as well. It should generate an ellipse with the left focus-point at excactly
0,0,0.
Create some materials:
- Create a material called 'earth-col' with 'EarthCol.iff' as a map. Tile x
on and -1. Grade x and grade y could be applied. Set the
Angle Scope handler with a = -1.1, and b = 0. Rest is default.
- Create a material called 'moon-col' with 'MoonCol.iff' as a map. Tile x on
and -1. Grade x and grade y could be applied. Set the Angle
Scope handler wih a = -1.1, and b = 0. Rest is default.
- Create a material called 'transp-map' with 'TranspMap.iff' as a map. Color
off, and transp map on. Grade x and Egde x to prevent restarting. Tiling
should be off. Rest is default.
Then we need to create a working hierarchy for the earth body:
- Change the root name to 'solar-system'
- In this, create a level called 'system-earth'
- In this, create a level called 'planet-earth'
- In this, create a level called 'rotating'
- In this, create a level called 'parts'
- Step one up, to 'rotating', and create a level called 'ROTATION' to mark
it as a future method holder
- Step one up, to 'planet-earth', and create a level called 'radiosity'
- In this, create a level called 'SKELETON' to mark it as a future method holder
- Step up to 'planet-earth' and create a level called 'transp', and set the
mapping flag
- Enter this, and create a level called 'SKELETON' to mark it as a future method
holder
The moon is also a part of the earth going around the sun, so:
- Step up to 'system-earth' and create a level called 'system-moon'
- In this, create a level called 'moon-moon' (for Jupiter one could have created
moon-io, moon-europa etc)
- In this, create a level called 'rotating'
- In this, create a level called 'parts'
- Step one up, to 'rotating', and create a level called 'ROTATION', to mark
it as a future method holder
- Step one up, to 'moon-moon', and create a level called 'radiosity'
- In this, create a level called 'SKELETON' to mark it as a future method holder
- Step up to 'moon-moon' and create a level called 'transp', and set the mapping
flag
- In this, create a level called 'SKELETON' to mark it as a future method holder
- Step up to 'system-moon' and create a level called 'PATH' to mark it as a
future method holder
- Step up to 'system-earth' and create a level called 'PATH' to mark it as
a future method holder
Okay, let us check what we have. Your working hierarchy should look
like this:
solar-system
system-earth
planet-earth
rotating
parts
ROTATION
radiosity
SKELETON
transp(T)
SKELETON
INV KINEMATIC
system-moon
moon-moon
rotating
parts
ROTATION
radiosity
SKELETON
transp(M)
SKELETON
PATH
PATH
Inner parts are modelled first, so lets create the moon:
- Enter the 'parts' level somewhere inside the 'moon-moon' level.
- Take a top view, and create a sphere about 0.1 m in diameter in the center
(0,0,0).
- Create a spherical mapping with the moon-col map.
Make the moon rotate about its axis:
- Enter the ROTATION level somewhere in the moon-moon level.
- Hit 'a' while this level is selected, select ROTATION, and set frequency
to 27.
- Take a front view, and create an axis from y=-0.2 to y=0.2. The direction
is important.
- Go back to and select the whole 'rotating' level, and rotate the object,
say, 10 degrees (our moon isn't actually tilted this way, this is just an
example), still from the front view.
Put the moon into an orbitlike path:
Let us test what we have so far:
- Bring up the animation window, use a high frame count, say 5000.
- Play the animation with a top view. You'll notice that the moon rotate one
time for each orbit, and this is just like real life for our moon. If you
change the frequency in the rotation level to a much higher number, say 600,
you will get a more earthlike orbit and rotation (though this is by far the
correct values). If we had used a perfect circle (eccentricity=0), then it
would have been possible to use a DIRECTION method instead of a PATH method
(provided the moon had only one rotation per orbit), and get rid of the ROTATION
method. But since the orbit we use in this case is slightly elliptical, we
have to use both PATH and ROTATION methods. This is also like the real life;
the moon will actually show us some (about 5%) of the 'darkside' during an
orbit. The more the elliptical the orbit path, the more of the darkside will
show. Also, remember I said something about using a TRANSFORM method to control
the speed of the orbiting body; if we had used DIRECTION here, the TRANSFORM
method would have affected both motions the DIRECTION controls.
- Take a front view, and play. Here you'll see that the axis is constantly
tilted during the animation. As you may know, the earth is tilted quite a
bit, and it is this tilt that gives us seasons.
We cannot complete the animation parts of the moon until its parent
body is done, the earth:
- Enter the 'parts' level somewhere inside the 'planet-earth' level.
- Take a top view, and create a sphere about 0.2 m in diameter in the center
(0,0,0) so that it is twice the size of the moon (which is just about the
case with the earth-moon system).
- Create a spherical mapping with the earth-col map.
Make the earth rotate about its axis:
- Enter the ROTATION level somewhere in the planet-earth level.
- Hit 'a' while this level is selected, select ROTATION, and set frequency
to 365 as we have roughly 365 days in a year.
- Take a front view, and create an axis from y=-0.2 to y=0.2. The direction
is important.
- Go back to and select the whole 'rotating' level, and rotate the object,
say, 20 degrees (it's actually more, but this is an example), still from
the front view.
Put the earth into an orbit like path:
- Go to the 'PATH' level somewhere in the 'system-earth' level and take a top
view.
- Hit 'z' and select the ellipse macro, with 2.5, 0.05 and earth-orbit as its
input.
- Select the 'PATH' level, hit 'a', and select PATH. Set frequency to 1.
- Go back and select the 'rotating' level, and move its objects to the rightmost
quadrant of the ellipse, which should be at about x=2.625.
- Take a top view and zoom close to the earth. Enter the 'transparency(T)'
level. Create a parallel mapping using the transp-map. Click first in the
upper left corner, and then in the lower right. Make sure it covers the earth
excactly. We need to create this at this stage to keep the transparancy map
properly aligned.
Now it is time to position the moon in respect to the earth:
- Go to the 'system-earth' level, select the 'system-moon' level.
- Take a top view and move this level from 0,0,0 to the center of the earth,
which should be at about x=2.625.
- Since we have already rotated the earth about 20 degrees, we now have to
rotate the whole 'moon-system' level accordingly. Select this level and rotate
it 20 degrees. However, not many moons have such a perfect inclination to
the parent bodys' equator, so we can rotate it a little more, say, an additional
4 degrees. Try to keep this number small.
Advanced animation, adding position independent 'radiosity'
Okay, so much for the easy part... Now we are going to add some 'radiosity'
to the animation in such a way that the sunlight that hits a body, gets reflected
back out into space directed towards the sun. I originally wanted to do this
with SKELETON and INV KINEMATIC animation methods with line parameters, but
due to a bug (or change) in v3.5, I will have to do this in a completely
different manner. Also, when using the skeleton primitive as a skeleton parameter
combined with a locked IK offset, the result was not satisfactory. Because
of that, I use a skeleton animation type, a normal line as the parameter,
and animating the endpoints of the line with groups. There probably are even
better ways to do this.
Create a spotlight controlled by a skeleton:
- Enter the 'radiosity' level somewhere in the 'moon-moon' level.
- Take a front view and create a spotlight from the moons center, pointing
to 0,0,0.
- Select the 'SKELETON' level, hit 'a', and change it to SKELETON animation
type.
- Enter the 'SKELETON' level, and create an axis from the moons center to 0,0,0.
Set the protected flag for the line which shall act as a skeleton.
- Enter the 'line' level, use 'Modify/Freeform/Divide to Groups', and set the
upper value to 1, lower is default. It's probably a good thing to change
the SIDE tags to 'moonline1' for the 'line', 'group', and 'group.1' objects
instead of the rather cryptic number. This is something worth doing other
times as well, to prevent dual tag numbers. It can't happen by itself, but
it is a good habit, because this is an easy mistake if you are used to copying
levels that contain groups, which should point to other objects. When doing
a 'Render Hierarchy' in a 'debugging' situation, the bug is easier to spot.
- Select the first group, hit 'B' to make it a level, and rename the level
to 'outer'
- Select the other group, hit 'B' to make it a level, and rename the level
to 'center'. Set the protected flag for this level.
- Enter the 'outer' level, and create a PATH method here, below the group.
Set frequency to 27.
- Find the 'moon-orbit' parameter curve in the 'PATH' level, which itself is
in the 'moon-moon' level. Change the SIDE tag to 'moon-orbit'. Create a link
object, cut the 'link' and paste it into the 'PATH' level inside the 'outer'
level of the line. Make sure to set the protected flag of the link. I use
to have the same name for the link and its object, but with a (l) to mark
it as a link, so you may want to change its name to 'moon-orbit(l)'.
- Go to the 'PATH' method in the 'system-earth' level, and copy the 'earth-orbit'
parameter curve.
- Go back to inside the 'line' level in the radiosity skeleton part. Create
a 'PATH' method within the line.
- Paste the 'earth-orbit' inside the 'PATH' method, and set the protected flag.
Have the moons transp-map be controlled by a skeleton in the same way:
- Take a front view.
- Enter the 'transp(T)' level somewhere in the 'moon-moon' level.
- Select the 'transp-map(T)' mapping object, and rotate it around the moons
center in such a way that it is in perfect alignment with the radiositys'
skeleton line (having the same tilt, pointing towards 0,0,0).
- Select the 'SKELETON' level, hit 'a', and change it to SKELETON animation
type.
- Enter the 'SKELETON' level, and create an axis from the moons center to 0,0,0.
Set the protected flag.
- Enter the 'line' level, use 'Modify/Freeform/Divide to Groups', and set the
upper value to 1, lower is default. Change the SIDE tags to 'moonline2' for
the 'line', 'group', and 'group.1'
- Select the first group, hit 'B' to make it a level, and rename the level
to 'outer'
- Select the other group, hit 'B' to make it a level, and rename the level
to 'center'. Set the protected flag for this level.
- Enter the 'outer' level, and create a PATH method here, below the group.
Set frequency to 27, and set the protected flag.
- Find the 'moon-orbit' parameter curve in the 'PATH' level, which itself is
in the 'moon-moon' level. Check that the SIDE tag is 'moon-orbit'. Creake
a link object, cut the 'link' and paste it into the 'PATH' level inside the
'upper' level of the line. Make sure to set the protected flag of the link.
Change its name to 'moon-orbit(l)'.
- Go to the 'PATH' method in the 'system-earth' level, and copy the 'earth-orbit'
parameter curve.
- Go back to inside the 'line' level in the transp(T) skeleton part. Create
a 'PATH' method within the line.
- Paste the 'earth-orbit' inside the 'PATH' method, and set the protected flag.
The moon is now complete, and luckily the spotlight of the earth is a bit easier :-)
- Enter the 'radiosity' level somewhere in the 'planet-earth' level
- Take a front view and create a spotlight from the earths center, pointing
to 0,0,0.
- Select the 'SKELETON' level, hit 'a', and change it to SKELETON animation
type.
- Enter the 'SKELETON' level, and create an axis from the earths center to 0,0,0.
- Set the protected flag for the line which shall act as a skeleton.
- Enter the 'line' level, use 'Modify/Freeform/Divide to Groups', and set the
upper value to 1, lower is default. Change the SIDE tags to 'earthline1'
for the 'line', 'group', and 'group.1' objects.
- Select the first group, hit 'B' to make it a level, and rename the level
to 'outer'
- Select the other group, hit 'B' to make it a level, and rename the level
to 'center'.
- Enter the 'outer' level, and create a PATH method here, below the group.
Set frequency to 1.
- Find the 'earth-orbit' parameter curve in the 'PATH' level, which itself
is in the 'system-earth' level. Change the SIDE tag to 'earth-orbit'. Create
a link object, cut the 'link' and paste it into the 'PATH' level inside the
'outer' level of the line. Make sure to set the protected flag of the link.
Change its name to 'earth-orbit(l)'.
Have the earths transp-map be controlled by a skeleton in the same
way:
- The actual map is perfectly aligned for the earth, as the earth has an inclination
of zero defined, so we won't do much here. However, for other planets, the
inclination is not zero, and you must align the map properly, as we already
did for the moon.
- Select the 'SKELETON' level, hit 'a', and change it to SKELETON animation
type.
- Enter the 'SKELETON' level, and create an axis from the earths center to
0,0,0. Set the protected flag.
- Enter the 'line' level, use 'Modify/Freeform/Divide to Groups', and set the
upper value to 1, lower is default. Change the SIDE tags to 'earthline2'
for the 'line', 'group', and 'group.1'
- Select the first group, hit 'B' to make it a level, and rename the level
to 'outer'
- Select the other group, hit 'B' to make it a level, and rename the level
to 'center'.
- Enter the 'outer' level, and create a PATH method here, below the group.
Set frequency to 1.
- Find the 'earth-orbit' parameter curve in the 'PATH' level, which itself
is in the 'system-earth' level. Check that the SIDE tag is 'earth-orbit'.
- Creake a link object, cut the 'link' and paste it into the 'PATH' level inside
the 'outer' level of the line. Make sure to set the protected flag of the
link. Change its name to 'earth-orbit(l)'.
Final Comments:
One could use a TRANSFORM method to alter velocity along the orbit, but I
don't know how to calculate it. You'd be better off choosing between 'radiosity'
effect or the correct change in velocity. Since I don't know how to calculate
it accurate enough, there is a picture below showing the typical TRANSFORM
curves one could use for the orbits of the moon and the earth.
How to calculate (x,y). p1=(0.0,0.0), p3=(0.5,0.5), and p5=(1.0,1.0). For the earth
p2 with x=0.25 then y=0.25-0.25*0.8(parameter)*0.05(eccentricity)=0.24. For the earth
p4 with x=0.75 will then be 1-0.24=0.76. For the moon p2 with x=0.25 then y=0.25
-0.25*0.8(parameter)*0.3(eccentricity)=0.19. For the moon
p4 with x=0.75 will then be 1-0.19=0.81. Note the shape of the curve. In the beginning
the angle is less steep than in the midle of the animation. Thus we can see the angle
as an indicator of velocity. Use 'Create/Controls/B-Spline Knot' to create the
actual curve. See the figure below.
Note1:
If you are going to try to use a TRANSFORM method to control the
speed of the main body (Earth), make sure that the TRANSFORM method is placed
directly above the whole earth-systems PATH method, so that none of the above
methods are affected. Therefore, one need to insert a TRANSFORM method directly
above the moons PATH method as well. You will have to calculate the parameter
curve (or SFOR formula) by yourself, as I am not a maths genius :-) or use the
method I presented above. Then you
will need to modify the animation system so that a TRANSFORM method is correctly
used in all other subanimation systems... and this is the reason it is not included
in this tutorial. Maybe a future tutorial will explain this. The file 'SimpleTransformEx.obj'
may provide some useful information about the TRANSFORM method, and how to apply
it in this situation.
Note2:
You'll probably notice that the moon-system has an extra unused
level. I have made it this way for easily implementation of more moons in
the moon-system level. Also, it's probably better to get used to one way
of doing things.
Note3:
If you want to make a complete solar-system of your own, I have included the
file 'orbitdata.txt' which contains all neccesary information. The right column
have already been scaled to the size I used once, but the FREQ numbers for the
PATH and DIRECTION methods will not be correct. (I made my own solar-system in
a completely different way than we did above, so please ignore the
FREQ values in the right column). In this tutorial we animated the
earth and moon using PATH and ROTATION, but for orbits that have
a close to zero eccentricity and 'stationary orbit' (like our moon) one could
have used DIRECTION method instead of PATH and ROTATION. Note that with
these values, bodies will become extremely small, and rendering errors may occur.
I.e. Deimos (one of mars' moons) would have measurements of 0.015 x 0.0122 x 0.011
mm (yes millimeters). Zooming in close to this and render, you would notice a
whole bunch of jagged egdes due to the accuracy Real3D provides.
Note4:
A very nice way to animate the solar-system as a whole, is to use
PATH methods only (forget all about skeletons, rotations and so forth), and
set the 2D-particle flag for all the bodies. Enable 'trails' post effect,
and render. This is a very fast way of showing the orbits in the solar-system.
One can produce a huge animation within a few hours.
Note5:
I have not been able to find specific information about the solar-system.
Therefore there might be things that are not even correct. As an example;
do the orbits have the same orientation (about the rest of the space) even
if it is a suborbit (like the moon)? If this was the case, it would be fairly
easy to change the way the orbits behave during the animation time.
I had to experiment a lot on which protected flags to set and which to not
set, so in case I have forgot some of the flags, I used the 'Custom/Modelling/Dump
Objects' function to generate this list, just in case:
-------------------------------------------------------------
| Boolean Invisib M Prot M L
| -------- ------- A ---- B I
| A I P W R C P P P L G
| N N N F T D P 1 2 U H
Objects | D V T I R T
-------------------------------------------------------------
solar-system | . . . . . . . . . . .
system-earth | . . . . . . . . . . .
planet-earth | . . . . . . . . . . .
rotating | . . . . . . . . . . .
parts | . . . . . . . . . . .
ellipsoid | . . . . . . . . . . .
earth-col | . . . . . X X . . . .
ROTATION | . . . . . . . . . . .
line | . . . . X X . . . . .
radiosity | . . . . . . . . . . .
light_spot | . . . . . . . . . . X
SKELETON | . . . . . . . . . . .
line | . . . . X X . X . . .
outer | . . . . . . . . . . .
group | . . . . . . . . . . .
PATH | . . . . . . . . . . .
earth-orbit(l) | . . . . . . . X . . .
center | . . . . . . . . . . .
group.1 | . . . . . . . . . . .
transp | . . . . . . X . . . .
transp-map | . . . . . X X . . . .
SKELETON | . . . . . . . . . . .
line | . . . . X X . X . . .
outer | . . . . . . . . . . .
group | . . . . . . . . . . .
PATH | . . . . . . . . . . .
earth-orbit(l) | . . . . . . . X . . .
center | . . . . . . . . . . .
group.1 | . . . . . . . . . . .
system-moon | . . . . . . . . . . .
moon-moon | . . . . . . . . . . .
rotating | . . . . . . . . . . .
parts | . . . . . . . . . . .
ellipsoid | . . . . . . . . . . .
moon-col | . . . . . X X . . . .
ROTATION | . . . . . . . . . . .
line | . . . . X X . . . . .
radiosity | . . . . . . . . . . .
light_spot | . . . . . . . . . . X
SKELETON | . . . . . . . . . . .
line | . . . . X X . X . . .
outer | . . . . . . . . . . .
group | . . . . . . . . . . .
PATH | . . . . . . . X . . .
moon-orbit(l) | . . . . . . . X . . .
center | . . . . . . . X . . .
group.1 | . . . . . . . . . . .
PATH | . . . . . . . . . . .
earth-orbit | . . . . X X . X . . .
transp | . . . . . . X . . . .
transp-map | . . . . . X X . . . .
SKELETON | . . . . . . . . . . .
line | . . . . X X . X . . .
outer | . . . . . . . . . . .
group | . . . . . . . . . . .
PATH | . . . . . . . X . . .
moon-orbit(l) | . . . . . . . X . . .
center | . . . . . . . X . . .
group.1 | . . . . . . . . . . .
PATH | . . . . . . . . . . .
earth-orbit | . . . . X X . X . . .
PATH | . . . . . . . . . . .
moon-orbit | . . . . X X . . . . .
PATH | . . . . . . . . . . .
earth-orbit | . . . . X X . . . . .
Lights and Rendering:
These are the setting I used for producing good pictures:
Normal Rendering mode
Ambient 0,0,0
Background 0,4,14
Brightness 20
Overlight 0
Antialiasing 4
Lightsamples 4
Supersample On
AutoExp Off
Rest as default
Earth radiosity spotlight:
Local radius 1.3
Brightness 5
Spot fade 20%
Spot angle 178
Light color 128,130,155
Earth sphere color 255,255,255
Material was replaced with a bigger texture map.
Moon radiosity spotlight:
Local radius 1.0
Brightness 8
Spot fade 20%
Spot angle 178
Light color 89,80,76
Moon sphere color 98,91,83
To simulate a sun, I have two lightplanes perpendicular to each other
in the center:
Size 0.4 x 0.4 m
No fading
Brightness 15
Light color 255,252,242
Material settings:
moon-col(T):
Color and Shadow Map On
High level texture
Tile x = -1
Grade x and y
Scope Angle a=-1.1 b=0
Effect = 100
moon-bmp(T):
Color, Bump and Shadow Map On
High level texture
Tile x = -1
Grade x and y
Bump height = 3
Scope Angle a=-1.1 b=0
Effect = 65
Earth-col(T):
Color map On
High level texture
Tile x = -1
Grade x and y
Scope Angle a=-1.1 b=0
Effect = 100