User Tools

Site Tools


Sidebar

Dan's Wiki

DokuWiki Instructions (local) DokuWiki Manual
Site Checker (Orphans Wanted)

Edit Sidebar

pc:software:xplane11:helloworldprocess

Basic HelloWorld example for 3D cockpit

(from here, scroll to bottom.)


The aim is to step through the process of creating the basic elements of a 3D
cockpit for X-Plane 10, using Blender 2.78 and XPlane2Blender 3.4.0.
 
The result will be a panel with an animated, clickable, textured switch, which
can be positioned in any orientation and work correctly.
 
The starting point is a copy of the stock RV-10.
 
1. Install XPlane2Blender as an addon to Blender
2. Create a new Blender project, saving it in the aircraft's Objects folder
(which you will have to create)
3. Invert the faces of the starting cube
4. In Scene Properties:
   - Add X-Plane Layers
   - Name Layer 1 to "../RV-10_cockpit"
   - Set type of Layer 1 to "Cockpit"
   - Click on "Export OBJs"
 
At this point, upon reloading the aircraft it will be in 3D-cockpit mode, with
the camera inside a plain grey cube.
 
5. Edit the cube into something more cabin-shaped and UV-unwrap it
6. Create a texture for the cube, named RV-10_cockpit.png and saved in the
aircraft folder
7. In Scene Properties, untick "Autodetect Textures" and manually select this
texture as the default texture
 
Upon reloading the aircraft, you will be sat in a textured, vaguely cockpit-
shaped box.
 
8. Create and unwrap a bezel, sitting proud of the front panel, in layer 1
9. Create a needle as a separate object, pointing straight upwards
10. Create an Armature - Single Bone, on the same axis as the pivot of the
needle and the centre of the bezel. Scale to suit.
11. Apply Rotation and Scaling to all three objects
12. Make the bezel the Object Parent of the bone
13. Make the bone the Bone parent of the needle
14. Select the bone, and in Bone Properties, add this dataref:
sim/flightmodel2/controls/flap1_deploy_ratio
15. Switch to Pose mode, and on frame 1, insert a Rotation keyframe
16. In Bone Properties, add an X-Plane keyframe (key icon) when the dataref
value is 0
17. Select frame 101
18. Rotate the bone on the y-axis by 120°
19. Insert a Rotation keyframe
20. In Bone Properties, add an X-Plane keyframe when the dataref value is 1
 
You should now have a flap position gauge
 
21. Add a new rectangular plane object in front of the top half of the gauge
22. Create a new material for it, named "Manipulator"
23. Untick "Draw Linked Objects" for the "Manipulator" material
24. In Object Properties, tick "Manipulator"
25. Set Type to "Command", Cursor to "Up", and Command to
"sim/flight_controls/flaps_up"
26. Make the bezel the Object Parent of the manipulator plane
27. Duplicate the manipulator plane on the lower half of the gauge
28. Change the manipulator properties for flaps_down
 
You can now click on the gauge to control the flaps
pc/software/xplane11/helloworldprocess.txt · Last modified: 2019/01/18 18:44 by dwheele