From d48850b96e1cc466bf4d56596ad60a99784aae3e Mon Sep 17 00:00:00 2001 From: yandeu <20306025+yandeu@users.noreply.github.com> Date: Sun, 5 Dec 2021 23:31:10 +0100 Subject: [PATCH] Minor changes --- www/scripts/three.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/scripts/three.ts b/www/scripts/three.ts index c9952b1..7346295 100644 --- a/www/scripts/three.ts +++ b/www/scripts/three.ts @@ -59,9 +59,9 @@ const MainScene = () => { scene.add(meshC_0, meshC_1, meshC_2) // add 2d text - const text = new TextTexture('some 2d text', { fontWeight: 'bold' }) + const text = new TextTexture('some 2d text', { fontWeight: 'bold', fontSize: 24 }) const sprite = new TextSprite(text) - sprite.setPosition(0 + text.width / 2, height - text.height / 2) + sprite.setPosition(0 + text.width / 2 + 12, height - text.height / 2 - 12) scene2d.add(sprite) // dpr @@ -142,6 +142,8 @@ const MainScene = () => { physics.update(clock.getDelta() * 1000) physics.updateDebugger() + // you have to clear and call render twice because there are 2 scenes + // one 3d scene and one 2d scene renderer.clear() renderer.render(scene, camera) renderer.clearDepth()