mirror of
https://github.com/status-im/whispervis.git
synced 2025-02-12 21:16:27 +00:00
Improve colors
This commit is contained in:
parent
63618a9e93
commit
0565d7211a
12
material.go
12
material.go
@ -16,8 +16,8 @@ const (
|
|||||||
// NewNodeMaterial creates a new default material for the graph node.
|
// NewNodeMaterial creates a new default material for the graph node.
|
||||||
func NewNodeMaterial() three.Material {
|
func NewNodeMaterial() three.Material {
|
||||||
params := three.NewMaterialParameters()
|
params := three.NewMaterialParameters()
|
||||||
params.Color = three.NewColor(0, 255, 0)
|
params.Color = three.NewColorRGB(0, 255, 0)
|
||||||
params.Transparent = true
|
params.Transparent = false
|
||||||
params.Opacity = DefaultTransparency
|
params.Opacity = DefaultTransparency
|
||||||
return three.NewMeshPhongMaterial(params)
|
return three.NewMeshPhongMaterial(params)
|
||||||
}
|
}
|
||||||
@ -25,7 +25,7 @@ func NewNodeMaterial() three.Material {
|
|||||||
// NewBlinkedNodeMaterial creates a new default material for the graph blinked node.
|
// NewBlinkedNodeMaterial creates a new default material for the graph blinked node.
|
||||||
func NewBlinkedNodeMaterial() three.Material {
|
func NewBlinkedNodeMaterial() three.Material {
|
||||||
params := three.NewMaterialParameters()
|
params := three.NewMaterialParameters()
|
||||||
params.Color = three.NewColor(255, 0, 0) // red
|
params.Color = three.NewColorRGB(255, 0, 0) // red
|
||||||
params.Transparent = true
|
params.Transparent = true
|
||||||
params.Opacity = DefaultTransparency
|
params.Opacity = DefaultTransparency
|
||||||
return three.NewMeshPhongMaterial(params)
|
return three.NewMeshPhongMaterial(params)
|
||||||
@ -34,8 +34,8 @@ func NewBlinkedNodeMaterial() three.Material {
|
|||||||
// NewEdgeMaterial creates a new default material for the graph edge lines.
|
// NewEdgeMaterial creates a new default material for the graph edge lines.
|
||||||
func NewEdgeMaterial() three.Material {
|
func NewEdgeMaterial() three.Material {
|
||||||
params := three.NewMaterialParameters()
|
params := three.NewMaterialParameters()
|
||||||
params.Color = three.NewColor(200, 200, 255)
|
params.Color = three.NewColorRGB(200, 200, 255)
|
||||||
params.Transparent = true
|
params.Transparent = false
|
||||||
params.Opacity = DefaultTransparency
|
params.Opacity = DefaultTransparency
|
||||||
return three.NewLineBasicMaterial(params)
|
return three.NewLineBasicMaterial(params)
|
||||||
}
|
}
|
||||||
@ -43,7 +43,7 @@ func NewEdgeMaterial() three.Material {
|
|||||||
// NewBlinkedEdgeMaterial creates a new default material for the graph blinked edge lines.
|
// NewBlinkedEdgeMaterial creates a new default material for the graph blinked edge lines.
|
||||||
func NewBlinkedEdgeMaterial() three.Material {
|
func NewBlinkedEdgeMaterial() three.Material {
|
||||||
params := three.NewMaterialParameters()
|
params := three.NewMaterialParameters()
|
||||||
params.Color = three.NewColor(255, 0, 0)
|
params.Color = three.NewColorRGB(255, 0, 0)
|
||||||
params.Transparent = true
|
params.Transparent = true
|
||||||
params.Opacity = DefaultTransparency
|
params.Opacity = DefaultTransparency
|
||||||
return three.NewLineBasicMaterial(params)
|
return three.NewLineBasicMaterial(params)
|
||||||
|
8
scene.go
8
scene.go
@ -80,10 +80,10 @@ func (w *WebGLScene) Reset() {
|
|||||||
// InitScene inits a new scene, sets up camera, lights and all that.
|
// InitScene inits a new scene, sets up camera, lights and all that.
|
||||||
func (w *WebGLScene) InitScene(width, height float64) {
|
func (w *WebGLScene) InitScene(width, height float64) {
|
||||||
w.camera = three.NewPerspectiveCamera(70, width/height, 1, 1000)
|
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 = three.NewScene()
|
||||||
w.scene.Background = three.NewColor(0, 0, 17/256)
|
w.scene.Background = three.NewColorRGB(0, 0, 17)
|
||||||
|
|
||||||
w.InitLights()
|
w.InitLights()
|
||||||
w.InitControls()
|
w.InitControls()
|
||||||
@ -92,11 +92,11 @@ func (w *WebGLScene) InitScene(width, height float64) {
|
|||||||
|
|
||||||
// InitLights init lights for the scene.
|
// InitLights init lights for the scene.
|
||||||
func (w *WebGLScene) InitLights() {
|
func (w *WebGLScene) InitLights() {
|
||||||
ambLight := three.NewAmbientLight(three.NewColor(0, 0, 0), 1)
|
ambLight := three.NewAmbientLight(three.NewColorHex(0xbbbbbb), 1)
|
||||||
ambLight.MatrixAutoUpdate = false
|
ambLight.MatrixAutoUpdate = false
|
||||||
w.scene.Add(ambLight)
|
w.scene.Add(ambLight)
|
||||||
|
|
||||||
light := three.NewDirectionalLight(three.NewColor(1, 1, 1), 1)
|
light := three.NewDirectionalLight(three.NewColor("white"), 1)
|
||||||
light.MatrixAutoUpdate = false
|
light.MatrixAutoUpdate = false
|
||||||
w.scene.Add(light)
|
w.scene.Add(light)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user