Tutorial 1 - Basics

This page describes how to build a simple scene with rotating monkey and interactive camera.

Boot up Blender located in Armory SDK and save the blend file.

Delete the cube and add monkey.

Create a new material for the monkey. Switch to node editor, delete the default Diffuse BSDF node and select Add - Group - Armory PBR. This node is recommended for the PBR workflow.

Switch to world nodes and add Sky Texture node. Set Background strength to 3.0.

Select Lamp and set Emission strength to 1000.

Back in 3D view, place a plane under the monkey.

To make monkey rotate, we will add a new trait. Select monkey and locate Armory Traits in object properties. Hit + to add empty trait. Set Haxe Script as type. Hit New Script and confirm.

Next, hit Edit Script and Kode Studio opens. We want to rotate the monkey a bit every frame. Uncomment notifyOnUpdate function and make it look like this:

notifyOnUpdate(function() {
    object.transform.rotate(armory.math.Vec4.zAxis(), 0.01);

If you want to use logic nodes instead, switch to node editor. Select logic nodes category, click New and compose the node tree below. In Armory Traits, select Logic Nodes as type and set Tree entry.

Switch back to 3D view, navigate to modifier properties and add Subdivision Surface modifier. Set Render subdivisions to 1.

In Render properties, locate Armory Player panel. Set Camera to Viewport. This will allow to control the camera with mouse and keyboard, similar to enabling walk navigation in viewport.

Ready to go! Hit Play in Viewport (shortcut P) to run.

Stop the player (shortcut ESC) and select Browser runtime in Armory Player panel. Hit Play (shortcut F5) and scene opens in the browser!

Get the blend file at GitHub.

results matching ""

    No results matching ""