-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added picture title, update threejs, image music playing wall detecti…
…on has severe bug - i only check collision agaist the image, so the raycaster will never detect collision with wall
- Loading branch information
Showing
6 changed files
with
139 additions
and
58 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { FontLoader } from 'three/examples/jsm/loaders/FontLoader' | ||
import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry' | ||
import * as dat from 'dat.gui' | ||
const gui = new dat.GUI() | ||
const fontLoader = new FontLoader() | ||
fontLoader.load('/fonts/helvetiker_bold.typeface.json', (font) => { | ||
const textConfig = { | ||
font: font, | ||
size: 0.7, | ||
height: 0.05, | ||
curveSegments: 6, | ||
bevelEnabled: false, | ||
} | ||
|
||
const geomery = new TextGeometry( | ||
'Picture caption (2022)', | ||
textConfig | ||
) | ||
geomery.center() | ||
const material = new THREE.MeshBasicMaterial( {color: 0x1e73e6} ) | ||
const text = new THREE.Mesh(geomery, material) | ||
|
||
const updateGeometry = () => { | ||
const geomery = new TextGeometry( | ||
'Picture caption (2022)', | ||
textConfig | ||
) | ||
geomery.center() | ||
text.geometry.dispose() | ||
text.geometry = geomery | ||
} | ||
|
||
scene.add(text) | ||
text.position.set(170-1, 17, 50) | ||
text.rotateY(-Math.PI / 2) | ||
gui.add(textConfig, 'size').min(0.1).max(10).step(0.1).onFinishChange(() => updateGeometry()) | ||
gui.add(textConfig, 'height').min(0).max(0.2).step(0.01).onFinishChange(() => updateGeometry()) | ||
gui.add(textConfig, 'curveSegments').min(0).max(30).step(1).onFinishChange(() => updateGeometry()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.