INNER CODE UNIT · Go

NewPointLightMesh

g3n/g3nd · util/lightmesh.go:19

func NewPointLightMesh(color *math32.Color) *PointLightMesh {

	l := new(PointLightMesh)

	geom := geometry.NewSphere(0.05, 16, 8)
	mat := material.NewStandard(color)
	mat.SetUseLights(0)
	mat.SetEmissiveColor(color)
	l.Mesh = graphic.NewMesh(geom, mat)
	l.Mesh.SetVisible(true)

	l.Light = light.NewPoint(color, 1.0)
	l.Light.SetPosition(0, 0, 0)
	l.Light.SetLinearDecay(1)
	l.Light.SetQuadraticDecay(1)
	l.Light.SetVisible(true)

	l.Mesh.Add(l.Light)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…