MicroCity NotesMicroCity Notes
Notes
  • MicroCity Web
  • MicroCity Desktop

    • 1. MicroCity Introduction
    • 2. Getting Started with MicroCity
    • 3. User Interface
    • 4. Script Writing
  • GitHub

    • MicroCity Desktop Repository
    • MicroCity Web Repository
    • MicroCity Web Online Environment
  • 简体中文
  • English
Notes
  • MicroCity Web
  • MicroCity Desktop

    • 1. MicroCity Introduction
    • 2. Getting Started with MicroCity
    • 3. User Interface
    • 4. Script Writing
  • GitHub

    • MicroCity Desktop Repository
    • MicroCity Web Repository
    • MicroCity Web Online Environment
  • 简体中文
  • English
  • MicroCity Documentation

    • Table of Contents
    • 1. MicroCity Introduction

      • 1.1 What MicroCity can Do
    • 2. Getting Started with MicroCity

      • 2.1 Showing a World Map
      • 2.2 Searching for Countries
    • 3. User Interface

      • 3.1 UI Overview
      • 3.2 Vector Shapes
      • 3.3 Raster Grids
      • 3.4 3D Scenes
      • 3.5 Tables
      • 3.6 Maps and Layers
      • 3.7 Modules
    • 4. Script Writing

      • 4.1 SI Overview
      • 4.2 UI Control
      • 4.3 Shapes and Tables
      • 4.4 Grids
      • 4.5 3D Scenes
      • 4.6 Networks
      • 4.7 Discrete Event Simulations
      • 4.8 Mixed Integer Programming

4.5 3D Scenes

Scenes and inside 3D objects (3.4) can be scripted. Sample codes for this chapter can be found in the "3d_samples" folder of the Project Tab in iconScriptEditor.

3D Scene and Object Manipulation

CreateScene ("Title" [, RotSpeed=1] [, TransSpeed=1])

Creates a new 3d scene and returns the object.

AddZipTo3DPath (Scene, "filename.zip")

Adds a zip file to the search directory and returns true if succeed. It is useful for collecting a large amount of files.

LoadSkybox (Scene, "top.jpg" ,"bottom.jpg" ,"left.jpg" ,"right.jpg" ,"front.jpg" ,"back.jpg")

Loads six image files as the skybox of a 3d scene.

LoadObject (Scene, "filename.3ds" [,shadow = false [, AnimationSpeed]])

Loads a 3d object from a file and returns the object.

AddLight (Scene, x, y, z, Radius [, r = 255, g = 255, b = 255])

Adds a light object and returns the object.

Add3DLabel(Scene, "label" [, width=10, height=10 [, r = 180, g = 180, b = 180 [, "font.xml"]]])

Adds a 3D label at (0,0,0) and returns the object.

Add3DLine (Scene, x1, y1, z1, x2, y2, z2 [, r = 0, g = 0, b = 0])

Adds a 3D line object frome (x1, y1, z1) to (x2, y2, z2) and retruns the object.

Add3DRect (Scene, length, width [, r = 180, g = 180, b = 180])

Adds a 3D rectangular object from (-length/2,0,-width/2) to (length/2,0,width/2) and returns the object.

Add3DBox (Scene, length, width, height [, r = 180, g = 180, b = 180 [, bShowEdge = true]])

Adds a 3D box object from (-length/2,-height/2,-width/2) to (length/2,height/2,width/2) and returns the object.

AddSphere (Scene, radius [, polycount = 16 [, r = 180, g = 180, b = 180]])

Adds a sphere at (0,0,0) and returns the object. If the radius parameter is less than 0, returns an invisible object.

GetTexture (Object)

Returns the texture files of a object: "filename1", "filename2", ... .

LoadTexture (Scene, Object, "filename1" [, "filename2", ...])

Loads texture files to an object.

SetPosition (Object, x, y, z [, absolute = false])

Sets the position of an object relative to its parent (or the absolute position to the scene).

GetPosition (Object [, absolute = false])

Gets the position of an object relative to its parent (or the absolute position to the scene).

SetRotation (Object, rx, ry, rz [, absolute = false])

Sets the rotation (left hand rule) of an object in degrees relative to its parent (or the absolute rotation to the scene).

GetRotation (Object [, absolute = false])

Gets the rotation (left hand rule) of an object in degrees relative to its parent (or the absolute rotation to the scene).

SetScale (Object, sx, sy, sz)

Sets the scale of an object.

GetScale (Object)

Gets the scale of an object.

SetParent (Object, Parent)

Attaches an object to another object as a child.

GetParent (Object)

Gets the parent of an object.

SetObject (Object "id" [,x, y, z, [,rx, ry, rz [,sx, sy, sz]]])

Sets the ID, position, rotation and scale of an object.

DelObject (Object)

Deletes an object.

SetCamera (Scene, x, y, z [,Tx, Ty, Tz])

Sets the position and target of the scene camera.

GetCamera (Scene)

Gets the camera object of a 3d scene and its position and targt.

GetSelections (Scene)

Returns selected objects from a 3d scene.

GetObjectID (Object1 [, Object2, ...])

Returns "id"s of objects.

SetObjectID (Object, "id")

Sets the id of an object.

GetObject (Scene, "id")

Finds an object by its id.

Last Updated:
Contributors: huuhghhgyg
Prev
4.4 Grids
Next
4.6 Networks