Table Of Contents

Previous topic

std.graphics.Billboard

Next topic

std.graphics.GUI

This Page

std.graphics.Graphics

Constructor

class std.graphics.Graphics(pres, name, cb, reset_cb)
Arguments:
  • pres
  • name
  • cb
  • reset_cb

Methods

addGUIModule(name, url, cb)
Arguments:
  • name
  • url
  • cb

Request that the given URL be added as a module in the UI.

addGUITextModule(name, js_text, cb)
Arguments:
  • name
  • js_text
  • cb

Request that the given script text be added as a module in the UI.

bbox(obj, on)
Arguments:
  • obj
  • on

Request the bounding box for the object be enabled or disabled.

camera()

Get basic camera description. This is read-only data.

cameraDirection(x, y)
Arguments:
  • x
  • y

Compute a vector indicating the direction a particular point in the camera’s viewport points. (x,y) should be in the range (-1,-1)-(1,1), the same as the values provided by mouse click and drag events. If no arguments are passed, this returns the central direction, i.e. the same as cameraDirection(0,0).

cameraOrientation()

Gets the camera’s current orientation. Note that this can be different from the position of the presence it is attached to because it may be in 3rd person mode. Useful if you need to figure out something based on the display, e.g. how a click on a particular x,y screen coordinate should map to the world.

cameraPosition()

Gets the camera’s current position. Note that this can be different from the position of the presence it is attached to because it may be in 3rd person mode. Useful if you need to figure out something based on the display, e.g. how a click on a particular x,y screen coordinate should map to the world.

createBrowser(name, url, cb)
Arguments:
  • name
  • url
  • cb

Request that the given URL be presented as a widget.

createGUI(name, url, width, height, cb)
Arguments:
  • name
  • url
  • width
  • height
  • cb

Request that the given URL be presented as a widget.

getGUIModule(name)
Arguments:
  • name

Get the GUI for a previously loaded GUI module.

hideLoadScreen()

Hides the loading screen. Call once you’re GUIs and basic loading is done.

maxObjects()

Get the maximum number of objects that will be displayed. Objects are prioritized intelligently, so nearer & larger objects are displayed instead of distant & small ones.

objectPrioritization()

Get the prioritization metric used for downloading and displaying (distance or solid_angle).

onTick(cb)
Arguments:
  • cb

Set a callback to be invoked once before each frame.

pick(x, y, ignore)
Arguments:
  • x (number) – the x-coorindate on screen
  • y (number) – the y-coordinate on screen
  • ignore (visible|presence|bool) – indicates whether to ignore some object, either by specifying the object or if a bool is provided, it indicates the presence that allocated the graphics object should be ignored.

Pick at the given location for an object. Stores the hit point which can be retrieved with pickedPosition().

pickedPosition()
quit()

Request that the OH shut itself down, i.e. that the entire application exit.

resume()

Request that the renderer resume rendering. If rendering wasn’t suspended, has no effect.

screenshot()

Request a screenshot be taken and stored on disk.

setCameraFarClip(d)
Arguments:
  • d

Set the camera’s far clip plane distance.

setCameraFOVY(v)
Arguments:
  • v

Set the camera’s far clip plane distance.

setCameraNearClip(d)
Arguments:
  • d

Set the camera’s near clip plane distance.

setCameraOrientation(orient)
Arguments:
  • orient

Set the camera’s orientation.

setCameraPosition(pos)
Arguments:
  • pos

Set the camera’s position.

setMaxObjects(maxobjs)
Arguments:
  • maxobjs

Set the maximum number of objects that will be displayed. Objects are prioritized intelligently, so nearer & larger objects are displayed instead of distant & small ones.

setObjectPrioritization(pri)
Arguments:
  • pri

Set the prioritization metric used for downloading and displaying (distance or solid_angle).

skybox(type, img, distance, tiling, curvature, orientation)
Arguments:
  • type
  • img
  • distance
  • tiling
  • curvature
  • orientation

Sets the skybox or disables it. param type ‘disabled’, ‘cube’, ‘dome’, or ‘plane’ param img the image URL to use param distance distance to box param tiling number of times to tile for ‘dome’ param curvature curvature for the dome param orientation quaternion specifying rotation of the box

stats()

Get renderer stats.

suspend()

Request that the renderer suspend rendering. It continues to exist, but doesn’t use any CPU on rendering.

toggleSuspend()

Request that the renderer toggle suspended rendering. See suspend and resume for details.

visible(obj, setting)
Arguments:
  • obj
  • setting

Marks an object as visible or invisible.