Fix lighting

This commit is contained in:
ochafik 2024-12-26 17:27:14 +00:00 • committed by Olivier Chafik
commit 5a67b2d554
2 changed files with 12 additions and 25 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 5 KiB

Before After
Before After

View file

@ -77,33 +77,20 @@ export async function exportGlb(data: IndexedPolyhedron, defaultColor: Color = D
const scene = doc.createScene()
.addChild(doc.createNode()
.setExtension('KHR_lights_punctual',
lightExt.createLight()
.setType(LightDef.Type.DIRECTIONAL)
.setIntensity(3.0)
.setColor([1.0, 1.0, 1.0]))
.setRotation([-0.3250576, -0.3250576, 0, 0.8880739]))
.addChild(doc.createNode()
.setExtension('KHR_lights_punctual',
lightExt.createLight()
.setType(LightDef.Type.DIRECTIONAL)
.setIntensity(2.0)
.setColor([0.9, 0.9, 1.0]))
.setRotation([0.6279631, 0.6279631, 0, 0.4597009]))
.addChild(doc.createNode()
.setExtension('KHR_lights_punctual',
lightExt.createLight()
.setExtension('KHR_lights_punctual', lightExt
.createLight()
.setType(LightDef.Type.DIRECTIONAL)
.setIntensity(1.0)
.setColor([1.0, 1.0, 1.0]))
.setRotation([0.7071068, 0, 0, 0.7071068]))
.setRotation([-0.3250576, -0.3250576, 0, 0.8880739]))
.addChild(doc.createNode()
.setExtension('KHR_lights_punctual',
lightExt.createLight()
.setExtension('KHR_lights_punctual', lightExt
.createLight()
.setType(LightDef.Type.DIRECTIONAL)
.setIntensity(0.5)
.setColor([0.8, 0.8, 0.8]))
.setRotation([-0.7071068, 0, 0, 0.7071068]));
.setIntensity(1.0)
.setColor([1.0, 1.0, 1.0]))
.setRotation([0.6279631, 0.6279631, 0, 0.4597009]));
;
const mesh = doc.createMesh();