What you need

 
 
Install ClearView under c:\SVKSystems.  Start ClearView, then select "Help" then "About" and check the version - it must be 4.98 or up. Close the program. Download  the latest ClearView code and save it over c:\SVKSystems\ClearView\bin\clearview.jar. The models in this tutorial are created in multiple steps. At the end of each step, all model files are saved as separate model.  The model name is constructed as xxModelNameyyy where xx is the lesson number and yyy is the step number. For example, 01FirstPlane001 is the model build in lesson 1, step 1.
 
Download Part 2 - Model physics and extract it under c:\SVKSystems\ClearView. Check if all lessons models are listed under c:\SVKSystems\ClearView\models. 

Part 2 - Model visualization

Step1 - Building the visual model

ClearView renders the visual model using file body.ac Any 3d model in that file will be shown. The model will behave physically according the physics objects in fmodel.ac and according the parameters set in params.txt  If we want to create a model with moving control surfaces, with rotating propellers (or helicopter rotors) or if we want breakable parts, we have to follow certain conventions when creating the model in body.ac Our first step is to design the actual model. We will have a special lesson how to design a 3d models in ac3d. In this lesson I will assume that you already created your plane and the model is textured and complete. We start with the model in Lesson 1 step 6 (the last step). This is flyable model where we created the physics objects in fmodel.ac Lets copy that model and then rename it to 02FirstPlane001  I open file body.ac and delete the model from there. Then I import my Yak 54 from file yak54.ac that I prepared in advance. Here is how this model looks in ac3d:
 
Let's look at the object list on the screen shot above: - We can see that the model is build as collection of objects, where each important model part is created as separate object.
 
Rule #1: Following parts must be build as separate objects:
 
  
The parts of the model that are not in this list may or may not be separate object. For maintenance reasons, they may be built as separate objects. For performance reasons, the total number of objects must be kept low (under 20-30).
 
Rule #2: Each part (object) must have unique name. The same names will be used for creating breakable parts in colbody.ac
 
Let's load model 02FirstPlane001 in ClearView - we can fly it, but the prop does not rotate and the control surfaces do not move:

Step 2 - make the control surfaces moveable

 I will describe in details how to make the rudder move. All other control surfaces can be done using the same method. Here is how this works:
 
The primary source for movement information is the corresponding lift surface in fmodel.ac Since I am working on the rudder, I open fmodel.ac and look what is the name for the rudder liftsurface:
 
 Asa you can see from the picture above, the name for the rudder liftsurface is rudder (the liftsurface consist of rudder.XYZObject and rudder.rud). By definition, the name for the liftsurface is the prefix (the name before the dot).
 
We have to create identically created movable object in body.ac Here is the definition of moveable object:
 

Definition: Moving part is coordinate system represented by XYZObject and set of 3d objects that are grouped together. 

The grouping is achieved by using qualified names.  For example, if we have XYZObject representing the rudder hinge axis, and a 3d object named for example ruder representing the rudder,  I will group them in single movable part by naming them like this:

rudder.XYZObject, rudder.ruder

I will show the process step by step. First, I load body.ac, select the whole model and lock it up. Then I import a XYZObject and name it rudder.XYZObject:

If we look at the rudder servo params section in params.txt we will see that servo rotates the rudder liftsurface around the Z axis on it's XYZObject.  Therefore, the movable object rudder in body.ac will be rotated around the Z axis of it's XYZObject. As we can see, as imported, the Z axis of the XYZObject is horizontal. I will rotate the liftsurface and align the Z axis to the rudder axis on the model. I will then position the XYZObject so the Z axis will be exactly on the rudder hinge. That way, any rotation from the servo on rudder lift surface in fmodel.ac will be duplicated as rotation of the model rudder around the Z axis of the rudder XYZObjecrt. Because that is the rudder hinge line, the rudder will rotate around it's hinge. Here is the result:

So now we created a moving part named rudder in body.ac:
rudder - consist of rudder.XYZObject (defines the rudder hinge) and rudder.ruder (the actual model rudder part).
This part is associated by name (rudder) to the liftsurface named rudder in fmodel.ac. The rudder servo in params.txt rotates the liftsurface rudder if fmodel.ac around the Z axis (parameter controlledAxisName z). ClearView applies the same rotation, around the same axis to rudder movable part in body.ac. Since the Z axis of the rudder.XYZObject for that part is aligned with the rudder hinge, the rudder in body.ac will rotate around it's hinge.  I repeat the same process for the model elevator and the ailerons. The result is stored ad 02FirstPlane002 - let's load it and move the sticks - we can see that these lift surfaces move accordingly:

Step 3 - make the prop rotate

The prop of a model typically consist of two parts - transparent object named propdisk (must be named that way) representing the spinning prop and the actual propeller (name is not important). Sometimes the prop cone is also present. Creating a moving propeller is based on the same principal used when creating moving surfaces - we import XYZObjects that we assosiate with the prop objects to define the coordinate system that will be used to spin the prop along one of the axes. Then we use proper naming to link the name of the prop moving objects in body.ac to the corresponding propeller physics object in fmodel.ac.
In this particular case, the physics Propeller object in fmodel.ac is named Propeller1. Here is what I did in body.ac:
1. I renamed the propeller object from prop to Propeller1.prop and the propeller cone object from propcone to Propeller1.propcone
2. I imported XYZObject and named it Propeller1.XYZObject
3. I rotated the Propeller1.XYZObject to the Y axis is parallel to the prop shaft and moved the object so the coordinate center is right on the center of the prop shaft.
4. I duplicated Propeller1.XYZObject and renamed the new copy to Proppeler1Disk.XYZObject (this is the convention for naming the prop disk movable object).
5. I renamed the prop dis object from propdisk to Propeller1Disk.propdisk
Here is how this look in ac3d:
This is all that is needed - I created two movable objects - Propeller1 and Propeller1Disk. They represent the propeller and the propeller disk. ClearView uses the rotation position for Propeller1 physics object from fmodel.ac to visually manage these two movable object. As result, my plane now have propeller that rotates and propeller disk that visually looks like spinning prop:
Now, I have model with movable surfaces and rotating propeller. The model is flyable with basic physics settings. After the model is completed it need parameters tune up that I will go over in separate document. The last step in creating this model is to create proper collision data for that exact model in colbody.ac Currently, the collision data is copy from fmodel.ac and is modeled after the physics model of the plane. In the next part I will go over how to create proper colbody.ac and how to make breakable parts.