anyKode Marilou
ContentsIndexHome
PreviousUpNext
The world

Creating the world.

We will create a rectangular area and put our robots inside. 

 

Step 1: The area
Step 
Description 
First box:

  1. Activate the world.mworld document,
  2. Create a box (Add-> Physics-> Box) and set lengths L=10.0, W=0.02, H=0.3,
  3. Center the box resetting its matrix (),
  4. Move the box on the Z axes to +0.15m (for putting it over the default ground that is at Z=0)
  5. Check the Compute Shadows property for allowing shadowing management.

 

 
Dressing the box:

  1. Select the box and show the Modify panel,
  2. Choose the Shape sub panel,
  3. Set diffuse color to white (255,255,255),
  4. Choose a texture file.

 

 
The area:

  1. Copy/paste the box 3 times (we have now 4 boxes),
  2. Move created boxes and rotate 2 boxes of 90° around Z axis.
  3. Move all boxes in order to complete rectangular area.

 

 
The ground:
The world owns a default ground (infinite plane at Z=0, see Configuration properties) that is used in physics (dynamic objects cannot go under the ground). But, this ground does not have any graphical display (shape). We will add a 3D plane for displaying the ground : this 3D object does not have any incidence on physics, it is just for displaying something !

  1. Create a 3D Plane (Add-> 3D-> Plane) in perspective view,
  2. Reset its matrix,
  3. Change lengths to L=20.0, W=20.0,
  4. Set diffuse color to white, and choose a texture file,
  5. You can select all entities and press G for grouping them.


Note: You can disable grid display for a view: activate the view then show the Display panel. Uncheck the Display Grid property. 

 
The light:

  1. Create a light (Add-> 3D-> Light),
  2. Move it at the desired location then set its Range property to 10.0m,
  3. Check the Generate Dynamic Shadows property for allowing shadowing from this light.


For displaying shadows you have to enable it from the Display panel (check Shadows).

Note: shadows are active if the object allow shadowing AND the light that illuminate object has the Dynamic Shadowing property checked. 

 

 

Step 2: Import robots
Step 
Description 
Import robot file (.mphx):

  1. Activate the Add panel and choose Physics From File,
  2. Browse the robot.mphx file,
  3. OK
  4. You are in 'Create Mode'

 

 

  1. In the perspective view, left click for starting PHX creating, move the mouse without releasing the left button for placing the PHX at the good location.
  2. Copy/Paste the created robot for cloning it.
  3. Move your second robot at the good location,
  4. Move the two robots along Z axis because the wheels are under the ground ...
  5. Rename the PHXs to robot0 and robot1.

 

 
Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
What do you think about this topic? Send feedback!