Oppedijk.com

Robotics‎ > ‎

CameraSprite

Using the CameraSpriteEntity from the Visual Simulation Engine

  1. Start a simulation with a robot with a camera (for instance a Pioneer 3DX)
  2. Go to Edit mode (Mode menu, choose edit)
  3. Entity Menu -> New...
  4. Choose CameraSprite, and as a parent the "robocam"
  5. Set Height and Width (e.g. both to 0.5 meter)
  6. Set Initial Pos (0,1,0) is 1 meter above the parent
  7. Pivot Y-axis or Center to make the view visible while turning the robot
  8. Press "OK" and choose "Mode -> Run"

Using the CameraSpriteEntity from code

 

1

2

3

4

CameraSprite camSprite = new CameraSprite(0.5f, 0.5f, SpritePivotType.Center, 0, 

new Vector3(0, 1, 0));

camSprite.State.Name = "cameraSprite";

camera.InsertEntity(camSprite);