oursin.meshes

Primitive meshes

Functions

create

Creates primitive meshes

delete

Deletes meshes

set_colors

Sets colors of mesh renderers

set_materials

Sets materials of mesh renderers

set_positions

Set the positions of mesh renderers

set_scales

Set scale of mesh renderers

Classes

Mesh

Mesh Object in Unity

class Mesh(position=[0.0, 0.0, 0.0], scale=[1, 1, 1], color='#FFFFFF', material='default')[source]

Bases: object

Mesh Object in Unity

create()[source]

Creates primitive mesh

Parameters

none

>>> cube_obj = urchin.primitives.Primitive()
delete()[source]

Deletes meshes

Parameters

references object being deleted

>>> cube_obj.delete() 
set_position(position)[source]

Set the position of mesh renderer

Parameters

positionlist of three floats

vertex positions of the mesh

Examples

>>> cube_obj.set_position([2,2,2])
set_scale(scale)[source]

Set the scale of mesh renderer

Parameters

scalelist of three floats

new scale of mesh

Examples

>>> cube_obj.set_scale([3,2,3])
set_color(color)[source]

Set the color of mesh renderer

Parameters

mesh_colorstring hex color

new hex color of mesh

Examples

>>> cube_obj.set_color("#000000")
set_material(material)[source]

Set the material of mesh renderer

Parameters

mesh_materialstring

name of new material

Examples

>>> cube_obj.set_material('opaque-lit')
create(num_objects)[source]

Creates primitive meshes

Parameters

num_objectsint
number of primitive objects to be created
>>> cubes = urchin.primitives.create(2)
delete(meshes_list)[source]

Deletes meshes

Parameters

meshes_listlist of mesh objects

list of meshes being deleted

>>> cubes.delete()
set_positions(meshes_list, positions_list)[source]

Set the positions of mesh renderers

Parameters

meshes_listlist of mesh objects

list of meshes being set

positions_listlist of list of three floats

vertex positions of each mesh

>>> urchin.primitives.set_positions(cubes,[[3,3,3],[2,2,2]])
set_scales(meshes_list, scales_list)[source]

Set scale of mesh renderers

Parameters

meshes_listlist of mesh objects

list of meshes being scaled

scales_listlist of list of three floats

new scales of each mesh

>>> urchin.primitives.set_scales(cubes,[[3,3,3],[2,2,2]])
set_colors(meshes_list, colors_list)[source]

Sets colors of mesh renderers

Parameters

meshes_listlist of mesh objects

list of meshes undergoing color change

colors_listlist of string hex colors

new hex colors for each mesh

>>> urchin.primitives.set_colors(cubes,["#000000","#000000"])
set_materials(meshes_list, materials_list)[source]

Sets materials of mesh renderers

Parameters

meshes_listlist of mesh objects

list of meshes undergoing material change

materials_listlist of strings

name of new materials

>>> urchin.primitives.set_material(cubes,['opaque-lit','opaque-lit'])