WebGL FinalMesh API | 3D Space

iv.space

3d Space, list of nodes, materials, textures and 3d properties.

Constructor

iv.space(wnd,gl)

Constructor creates new 3d space object. Usually space created from iv.window.

wnd 3d window
gl WebGL context.

 

Properties

root Root 3d node
gl WebGL context
window 3d window
view default view
root Root 3d node
materials Array of materials
cfgTextures true if textures are allowed
cfgDbl double sided rendering
cfgKeepMeshData &1 - keep faces, &2 - keep points
cfgDefMtl Default material. If null, per node materials will be used.
cfgSelZOffset If true, selected objects will have z offset
cfgRMode Default render mode. 0 is idefault value.
clrSelection Selection highlight color. [1,0,0] - Red is default color.
stdLights Array of lights. If set, this lights will override lights in scene.

 

.newMaterial(data)

Method creates new material

data

If string - this will be name of material. You should create material channels after that.

If object - data for material properties. This data may include name, colors, blending, textures, etc.
For description of material please see WebGL material.

.getMaterial(name)

This method searches material by name and returns it.

name Name of material.

If material was found it will be returned. If such material was not found, null will be returned.

.invalidate(flags)

Method marks viewport as invalid and scheduled update for the next frame. This method invokes iv.window.invalidate

flags

[optional] may be undefined or bit combinations of:

  • iv.INV_VERSION Update camera, increment current camera version. Version may be used by billboards in order to update position only when required.
  • iv.INV_MTLS Flush shaders in materials. Same as view.space.invalidateMaterials()

Default is 0.

.invalidateMaterials()

Method removes all shaders from materials. Method may be used after some changes in scenes, for instance after chaning lights.

.render()

Used internally for rendering scene.

 

Rest methods are used internally.