Skip to content

Instantly share code, notes, and snippets.

@aosterthun
Created March 14, 2017 18:57
Show Gist options
  • Save aosterthun/29dd277ba935cd0726feab2d7aa20fec to your computer and use it in GitHub Desktop.
Save aosterthun/29dd277ba935cd0726feab2d7aa20fec to your computer and use it in GitHub Desktop.
def createCube(self,PARENT_NODE, pickResult, cubeSize, cubeOffset):
_loader = avango.gua.nodes.TriMeshLoader()
_newCubePosition = pickResult.WorldPosition.value + (pickResult.WorldNormal.value * (cubeSize + cubeOffset))
cubeNode = _loader.create_geometry_from_file(
"Cube " + str(_newCubePosition.x) + str(_newCubePosition.y) + str(_newCubePosition.z), "data/objects/cube.obj",
avango.gua.LoaderFlags.DEFAULTS | avango.gua.LoaderFlags.MAKE_PICKABLE)
cubeNode.Transform.value = avango.gua.make_trans_mat(_newCubePosition)
PARENT_NODE.Children.value.append(cubeNode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment