mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-23 04:21:24 +01:00
Change the way the label faces the camera
This commit is contained in:
parent
6ceb9497ae
commit
280c71bbf2
1 changed files with 2 additions and 2 deletions
|
|
@ -275,7 +275,7 @@ async function createMesh(width, height, segmentsX, segmentsY) {
|
||||||
const [x, y, z] = get3dCoords(label.x.baseVal[0].value, label.y.baseVal[0].value)
|
const [x, y, z] = get3dCoords(label.x.baseVal[0].value, label.y.baseVal[0].value)
|
||||||
text_mesh.position.set(x, y + 15, z);
|
text_mesh.position.set(x, y + 15, z);
|
||||||
text_mesh.animate = function () {
|
text_mesh.animate = function () {
|
||||||
this.lookAt(camera.position);
|
this.rotation.copy(camera.rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
textMeshs.push(text_mesh)
|
textMeshs.push(text_mesh)
|
||||||
|
|
@ -290,11 +290,11 @@ async function createMesh(width, height, segmentsX, segmentsY) {
|
||||||
const [x, y, z] = get3dCoords(label.x.baseVal[0].value, label.y.baseVal[0].value)
|
const [x, y, z] = get3dCoords(label.x.baseVal[0].value, label.y.baseVal[0].value)
|
||||||
text_mesh.position.set(x, y + 5, z);
|
text_mesh.position.set(x, y + 5, z);
|
||||||
text_mesh.animate = function () {
|
text_mesh.animate = function () {
|
||||||
this.lookAt(camera.position);
|
|
||||||
if(this.position.distanceTo(camera.position) > 200) {
|
if(this.position.distanceTo(camera.position) > 200) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
} else {
|
} else {
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
|
this.rotation.copy(camera.rotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue