03-02-2026, 05:29 PM
Update #2
I've added support for a number of the three.js "Primitives". These are basic 3D shapes that can be used as building blocks in a 3D scene. You can preview them here:
It's pretty neat to see how quickly you can put together a simple 3D scene using these primitives.
For example, we could build a simple tree using just the cylinder and cone shapes. Start by drawing a brown cylinder for the base:
Then add a green cone on top:
Then we can use the Clone function to copy the green cone a couple of times and stack them on top by changing the position:
Finally, you could use the Clone function again and some RNG to generate a whole forest:
I've added support for a number of the three.js "Primitives". These are basic 3D shapes that can be used as building blocks in a 3D scene. You can preview them here:
- Box
- Circle
- Cone
- Cylinder
- Dodecahedron
- Icosahedron
- Octahedron
- Plane
- Sphere
- Tetrahedron
- Torus
- TorusKnot
It's pretty neat to see how quickly you can put together a simple 3D scene using these primitives.
For example, we could build a simple tree using just the cylinder and cone shapes. Start by drawing a brown cylinder for the base:
Code: (Select All)
Function CreateTree
Dim As Object material, geometry, opts, tree, mesh
' Create a cylinder trunk
geometry = THREE.CylinderGeometry(1, 1, 3)
opts.color = &H663300
material = THREE.MeshPhongMaterial(opts)
tree = THREE.Mesh(geometry, material)
tree.position.y = 1.5
CreateTree = tree
End Sub
Then add a green cone on top:
Code: (Select All)
Function CreateTree
Dim As Object material, geometry, opts, tree, mesh
' Create a cylinder trunk
geometry = THREE.CylinderGeometry(1, 1, 3)
opts.color = &H663300
material = THREE.MeshPhongMaterial(opts)
tree = THREE.Mesh(geometry, material)
tree.position.y = 1.5
' Create a cone for the branches
geometry = THREE.ConeGeometry(4, 8)
opts.color = &H336600
material = THREE.MeshPhongMaterial(opts)
mesh = THREE.Mesh(geometry, material)
THREE.Add tree, mesh
mesh.position.y = 5
CreateTree = tree
End Function
Then we can use the Clone function to copy the green cone a couple of times and stack them on top by changing the position:
Code: (Select All)
Function CreateTree
Dim As Object material, geometry, opts, tree, mesh
' Create a cylinder trunk
geometry = THREE.CylinderGeometry(1, 1, 3)
opts.color = &H663300
material = THREE.MeshPhongMaterial(opts)
tree = THREE.Mesh(geometry, material)
tree.position.y = 1.5
' Create 3 stacked cones for the branches
geometry = THREE.ConeGeometry(4, 8)
opts.color = &H336600
material = THREE.MeshPhongMaterial(opts)
mesh = THREE.Mesh(geometry, material)
THREE.Add tree, mesh
mesh.position.y = 5
mesh = THREE.Clone(mesh)
THREE.Add tree, mesh
THREE.Set mesh.scale, .8, .8, .8
mesh.position.y = 7
mesh = THREE.Clone(mesh)
THREE.Add tree, mesh
THREE.Set mesh.scale, .6, .6, .6
mesh.position.y = 9
CreateTree = tree
End Function
Finally, you could use the Clone function again and some RNG to generate a whole forest:


