diff --git a/material.go b/material.go index 3012170..c10336a 100644 --- a/material.go +++ b/material.go @@ -16,8 +16,8 @@ const ( // NewNodeMaterial creates a new default material for the graph node. func NewNodeMaterial() three.Material { params := three.NewMaterialParameters() - params.Color = three.NewColor(0, 255, 0) - params.Transparent = true + params.Color = three.NewColorRGB(0, 255, 0) + params.Transparent = false params.Opacity = DefaultTransparency return three.NewMeshPhongMaterial(params) } @@ -25,7 +25,7 @@ func NewNodeMaterial() three.Material { // NewBlinkedNodeMaterial creates a new default material for the graph blinked node. func NewBlinkedNodeMaterial() three.Material { params := three.NewMaterialParameters() - params.Color = three.NewColor(255, 0, 0) // red + params.Color = three.NewColorRGB(255, 0, 0) // red params.Transparent = true params.Opacity = DefaultTransparency return three.NewMeshPhongMaterial(params) @@ -34,8 +34,8 @@ func NewBlinkedNodeMaterial() three.Material { // NewEdgeMaterial creates a new default material for the graph edge lines. func NewEdgeMaterial() three.Material { params := three.NewMaterialParameters() - params.Color = three.NewColor(200, 200, 255) - params.Transparent = true + params.Color = three.NewColorRGB(200, 200, 255) + params.Transparent = false params.Opacity = DefaultTransparency return three.NewLineBasicMaterial(params) } @@ -43,7 +43,7 @@ func NewEdgeMaterial() three.Material { // NewBlinkedEdgeMaterial creates a new default material for the graph blinked edge lines. func NewBlinkedEdgeMaterial() three.Material { params := three.NewMaterialParameters() - params.Color = three.NewColor(255, 0, 0) + params.Color = three.NewColorRGB(255, 0, 0) params.Transparent = true params.Opacity = DefaultTransparency return three.NewLineBasicMaterial(params) diff --git a/scene.go b/scene.go index 60f7b0c..d3189c1 100644 --- a/scene.go +++ b/scene.go @@ -80,10 +80,10 @@ func (w *WebGLScene) Reset() { // InitScene inits a new scene, sets up camera, lights and all that. func (w *WebGLScene) InitScene(width, height float64) { w.camera = three.NewPerspectiveCamera(70, width/height, 1, 1000) - w.camera.Position.Set(0, 0, 400) + w.camera.Position.Set(0, 0, 100) w.scene = three.NewScene() - w.scene.Background = three.NewColor(0, 0, 17/256) + w.scene.Background = three.NewColorRGB(0, 0, 17) w.InitLights() w.InitControls() @@ -92,11 +92,11 @@ func (w *WebGLScene) InitScene(width, height float64) { // InitLights init lights for the scene. func (w *WebGLScene) InitLights() { - ambLight := three.NewAmbientLight(three.NewColor(0, 0, 0), 1) + ambLight := three.NewAmbientLight(three.NewColorHex(0xbbbbbb), 1) ambLight.MatrixAutoUpdate = false w.scene.Add(ambLight) - light := three.NewDirectionalLight(three.NewColor(1, 1, 1), 1) + light := three.NewDirectionalLight(three.NewColor("white"), 1) light.MatrixAutoUpdate = false w.scene.Add(light) }