Пример #1
0
func main() {
	camera = cameras.NewPerspectiveCamera(70.0, float64(WIDTH/HEIGHT), 1.0, 1000.0)
	camera.Position.Z = 400

	scene = scenes.NewScene()

	geometry := geometries.NewDefaultBoxGeometry(200, 200, 200)
	material := materials.NewMeshBasicMaterial(map[string]interface{}{"color": 0xffffff})

	mesh = objects.NewMesh(geometry, material)
	scene.Add(mesh)

	renderer = renderers.NewWebGLRenderer(map[string]interface{}{
		"width":  WIDTH,
		"height": HEIGHT,
	})

	animate()
}
Пример #2
0
func NewDefaultMesh() *Mesh {
	return NewMesh(core.NewGeometry(), materials.NewMeshBasicMaterial(map[string]interface{}{"color": rand.Intn(0xffffff)}))
}