mirror of
https://github.com/Sheldan/canvas.git
synced 2026-04-05 17:17:01 +00:00
always show planet names in front of moon names
This commit is contained in:
@@ -183,13 +183,18 @@ function initScene(font) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let textDistance = 2;
|
let textDistance = 2;
|
||||||
if (sphereConfig.isMoon) {
|
let isMoon = sphereConfig.isMoon;
|
||||||
|
if (isMoon) {
|
||||||
textDistance = 5;
|
textDistance = 5;
|
||||||
}
|
}
|
||||||
const textMesh = new THREE.Mesh(label, material);
|
const textMesh = new THREE.Mesh(label, material);
|
||||||
textMesh.scale.set( scale, scale, scale );
|
textMesh.scale.set( scale, scale, scale );
|
||||||
textMesh.position.x = textDistance * objectRadius * (Math.random() * textDistance - textDistance) + Math.random() * config.AU / 10;
|
textMesh.position.x = textDistance * objectRadius * (Math.random() * textDistance - textDistance) + Math.random() * config.AU / 10;
|
||||||
textMesh.position.y = textDistance * objectRadius * (Math.random() * textDistance - textDistance) + Math.random() * config.AU / 10;
|
textMesh.position.y = textDistance * objectRadius * (Math.random() * textDistance - textDistance) + Math.random() * config.AU / 10;
|
||||||
|
if(!isMoon) {
|
||||||
|
textMesh.renderOrder = 999;
|
||||||
|
textMesh.material.depthTest = false
|
||||||
|
}
|
||||||
texts.push(textMesh)
|
texts.push(textMesh)
|
||||||
group.add(textMesh);
|
group.add(textMesh);
|
||||||
sphereConfig.text = textMesh;
|
sphereConfig.text = textMesh;
|
||||||
|
|||||||
Reference in New Issue
Block a user