Robosim Studio Documentation

Go back to Robosim Studio

Table of Contents

  1. Introduction
  2. UI Overview
  3. Controls
  4. Skybox Settings
  5. Ambient Light
  6. Adding Lights
  7. Adding Objects
  8. Compiling
  9. JSON Generation and Execution
  10. ADVANCED: Scripting
  11. Exporting and Publishing

1. Introduction

Robosim Studio is a powerful 3D scene editor that allows you to create immersive Robosim experiences. As a clone of Roblox within the Websim environment, Robosim enables you to design and build interactive 3D worlds, games, and simulations. With Robosim Studio, you can add various objects, configure lighting, and even add custom scripts to objects for dynamic behavior, all within a user-friendly interface that makes it easy to bring your creative visions to life.

2. UI Overview

The Robosim Studio interface is divided into two main sections:

3. Controls

When interacting with the 3D viewport:

Note: Click on the 3D viewport to enable these controls. Press ESC to release mouse control.

4. Skybox Settings

The skybox is the background of your 3D scene. You can change its color using the color picker in the Skybox Settings section.

Default value: #87CEEB (Sky blue)

5. Ambient Light

Ambient light is the general background lighting of your scene. You can adjust its color and intensity.

Property Default Value Description
Color #ffffff (White) The color of the ambient light
Intensity 0.5 The brightness of the ambient light (range: 0 to 1)

6. Adding Lights

You can add various types of lights to your scene to create more complex lighting setups.

Property Default Value Description
Type Point Light Choose between Point, Spot, or Directional light
Color #ffffff (White) The color of the light
Intensity 1.0 The brightness of the light (range: 0 to 2)
Position (X, Y, Z) 0, 0, 0 The position of the light in 3D space

7. Adding Objects

You can add various 3D objects to your scene and customize their properties.

Property Default Value Description
Name (Empty) A name for your object
Position (X, Y, Z) 0, 0, 0 The position of the object in 3D space
Shape Cube Choose between Cube, Sphere, Cylinder, Cone, Torus, or Plane
Scale (X, Y, Z) 1, 1, 1 The size of the object in each dimension
Rotation (X, Y, Z) 0, 0, 0 The rotation of the object in degrees
Color #00ff00 (Green) The color of the object
Metalness 0.3 How metallic the object appears (range: 0 to 1)
Roughness 0.4 How rough or smooth the object appears (range: 0 to 1)

8. Compiling

The "Compile" button is the recommended way to generate and execute your Robosim scene. When you click this button, it performs the following actions:

  1. Generates the JSON representation of your scene
  2. Waits for 2 seconds to ensure all data is properly processed
  3. Executes the generated JSON, updating the 3D viewport with your changes
Recommendation: We highly recommend using the "Compile" button instead of manually generating and executing JSON. This method ensures a smoother workflow and reduces the chance of errors that might occur when performing these steps separately.

9. JSON Generation and Execution

While compilation is the recommended method, you can still generate and execute JSON separately if needed:

Note: Manual JSON generation and execution should mainly be used for advanced operations or troubleshooting.

10. ADVANCED: Scripting

Robosim Studio allows you to add custom scripts to objects, enabling dynamic behaviors and interactions. These scripts are executed each frame and are attached directly to the objects.

Basic Principles:

Example 1: Rotating an Object

this.rotation.y += 0.01;

This script rotates the object around its Y-axis. Each frame, it increases the Y rotation by 0.01 radians, creating a continuous spinning effect.

Example 2: Up and Down Movement

this.position.y = Math.sin(Date.now() * 0.001) * 2;

This script makes the object move up and down. It uses a sine wave based on the current time to create a smooth, oscillating motion. The object will move 2 units up and down from its original position.

Example 3: Collision Detection

const box1 = scene.getObjectByName({object_name}, true);
const box2 = scene.getObjectByName({object_name}, true);

function checkCollision() {
    const box1BB = new THREE.Box3().setFromObject(box1);
    const box2BB = new THREE.Box3().setFromObject(box2);

    if (box1BB.intersectsBox(box2BB)) {
        // Objects are colliding
        box2.material.color.set(0x00ff00); // Green
    } else {
        // Objects are not colliding
        box2.material.color.set(0xff0000); // Red
    }
}

checkCollision();

This script checks if two objects (box1 and box2) are colliding. It creates bounding boxes around each object and checks if they intersect. If they do, it changes the color of box2 to green. If not, it changes the color to red. This script should be attached to one of the objects involved in the collision check.

Remember to replace {object_name} with the actual names of your objects when using these scripts.

11. Exporting and Publishing

Once you've finished creating your Robosim scene, you can export and publish it for others to enjoy. Here's how:

  1. Click the "Generate JSON" button to create the JSON representation of your scene.
  2. Copy the generated JSON code.
  3. Go back to the main Robosim platform.
  4. Look for the "Publish" or "Upload" option (the exact wording may vary).
  5. Paste your copied JSON code into the designated field.
  6. Fill in any additional required information (e.g., title, description).