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
xxModelName
yyy where
xx is the lesson number and
yyy is the step number. For example,
01FirstPlane001 is the model build in lesson 1, step 1.
Part 3 - Create the collision model and breakable parts
Step1 - Colision model explained
ClearView uses quite advanced physics simulation to provide very realistic interaction between the model and the world objects. The model as represented in model.ac is built with many thousands of surfaces and is optimised for best visual representation (rendering). While the same model can be used for collision detection and ground and world objects interaction, this is not practical from performance standpoint. For that only reason, ClearView uses a separate 3d model, as created in colbody.ac for the colision detection and object interaction. This model is a simplified version of the model in body.ac. The plane I am working on is created with very few surfaces and is quite optimal (the surface count is low). If I look in ac3d, in Tools, then Model Info I can see that the model has 25 objects, 1999 surfaces and 1806 vertices. Because of that , I save body.ac as colbody.ac and I will be able to load the model in ClearView and the program will work fine on faster systems. Further optimisation is needed to create efficient model for slow computers. Let's load 03FirstPlane001 in ClearView and try it. If the model is slow, continue with the next step. You can see now that the model will crahs and reload if you hit the ground with the propeller. This is because the propeller disk is named propdisk - when ClearView detects that object named propdisk hits the ground or another object, ClearView will stop the engine and mark the model as crashed. The program will then waith a number of seconds as defined in crashResetTime parameter in startupParams.txt and will then reload. Another special object names are maingear1, maingear2, tailgear and nosegear. ClearView provides special handling for such objects and they behave as model wheels. ClearView turns tailgear and nosegear accordingly so the model can taxi on the ground properly. To ensure consistent ground handling, it is required that each of these gear objects ends with a simple triangle that points down - so it touches the flat ground surface at exactly one point. Here is how colbody.ac looks in step 1 (colbody.ac is simply taken from body.ac):
Step 2 - simplifying colbody.ac
I will examine every part for complexity. If the part is made from too many surfaces, I will replace the part with simplified part that will be used for collision detection. The simplified part approximates the original part but is much simpler. That improves the program performance on slow computers. This model wings are very low complexity. Normally, I will not simplify them. However, here is an example how a wing can be made simpler:
The simpler wing will replace the real wing in colbody.ac In collision, it will behave the same, but ClearView will run faster.
Let's look at model 03FirstPlane003 - I have optimized colbody.ac by replacing every object with similar form and size object with simplified geometry. The old file had 1999 surfaces and 1806 vertices. The new file stats are shown here:
Not bad. The new file has 169 surfaces vs 1999 for the old one and 279 vertices vs 1806 in the old one. This model will perform well on much slower computer and the behavior of the parts will be the same. Please note that normal model has about 5000-9000 surfaces and if not optimised, colbody.ac may lock even the fastest computer, because the computational requirements for collision detection increase in exponential manner.
Step 3 - breakable parts
Making breakable parts is easy if the model is properly created so each model part that can break is created as separate object in ac3d. Once proper bode.ac and colbody.ac files are created, we create breakable parts by simply adding a command "breakpart" in params section for each part we want to define as breakable.
Here is the checklist we must verify before adding breakable parts command in params.txt:
-
All important parts in body.ac must be as created separate objects
-
Each object must use the same surface types and have the same material assigned. Internally, ClearView threats a single object with two materials assigned as two objects. Therefore, you may not see correct rendering of the part when it break. To ensure correct surface type, select the objects and click on Poly and Smooth surface type (on the low left corner in ac3d)
-
Make sure model landing gear objects are named maingear1, manigear2, tailgear or nosegear
-
Make sure you have propdisk object (if you don't the model will not reload after crash)
If you go over the checklist and feel you have all in order, you are ready to add breakable parts in params section of params.txt
Here is the format for the breakpart declaration:
breakpart partName partType horizontalSpeed verticalSpeed crashSpeed breakForce partMass partId childPartId1 childPartId2
All speeds in breakpart declaration are in meters per second (m/s). One m/s is 3.6 km/h or 2.2 MPH (miles per hour).
partName - the part name. Must be the same in body.ac and colbody.ac
partType - 1 for all simple parts, 10 for prop disks, 12 for helicopter tail disks, 20 for helcopter rotor disks
horisontalSpeed - the part will break off if the part hits an object with horisontal speed component greater than that
verticalSpeed - the part will break off if the part hits an object with vertical speed component greater than that
crashSpeed - the part will break off if the model crashes awith speed greater than that
breakForce - (in Newtons) the part breaks if the part is hit with a force higher than that 1 kg object applies 9.8 N force on the ground)
partMass -part mass in Kg - leave it as 1 for now
partId - part id number (unique for each part)
childPartId1 - child part id. If the part breaks, the child part will break as well
childPartId2 - second child part id. If the part breaks, the child part will break as well.
Let's load model 03FirstPlane003 and open the Advanced Settings - we will see how I defined the breakable parts for this model:
That is about it - not hard at all. If you are interested in creating models for ClearView and have any questions, feel free to e-mail
support@rcflightsim.com and we will be glad to help.