|
@@ -470,14 +470,28 @@ export default class XSceneManager {
|
|
|
})
|
|
|
.then(response => response.json())
|
|
|
.then(response => {
|
|
|
+ this.texture = new BABYLON.Texture("https://4dkk.4dage.com/v3/img/marker.png", this.scene);
|
|
|
response.forEach(data => {
|
|
|
- // 当前json数据坐标处理有问题,x需取负,转BABYLON默认坐标
|
|
|
- // 又根据xversePosition2Ue4方法猜测,xverse坐标和BABYLON默认坐标xy方向相反,xz再次取负
|
|
|
+ var plane = new BABYLON.Mesh.CreatePlane("TextPlane", 0.2, this.scene, true);
|
|
|
+ plane.material = new BABYLON.StandardMaterial("TextPlaneMaterial", this.scene);
|
|
|
+ plane.material.alpha = 1,
|
|
|
+ plane.material.emissiveTexture = this.texture,
|
|
|
+ plane.material.backFaceCulling = true,
|
|
|
+ plane.material.diffuseTexture = this.texture,
|
|
|
+ plane.material.diffuseTexture.hasAlpha = !0,
|
|
|
+ plane.material.useAlphaFromDiffuseTexture = !0
|
|
|
+
|
|
|
+ plane.rotation.x = Math.PI / 2
|
|
|
+ plane.position.x = -data.position.x - 0.8; // 1
|
|
|
+ plane.position.y = data.position.y+0.01;
|
|
|
+ plane.position.z = data.position.z + 0.8; // 1
|
|
|
+
|
|
|
// todo 矫正
|
|
|
- let ue4Pos = util.xversePosition2Ue4({x: data.position.x-0.8, y: data.position.y, z: data.position.z+0.8})
|
|
|
+ let ue4Pos = util.xversePosition2Ue4({x: -data.position.x - 0.8, y: data.position.y, z: data.position.z + 0.8}) // 1
|
|
|
// console.error(data.position, ue4Pos)
|
|
|
data.position0 = data.position
|
|
|
data.position = new BABYLON.Vector3(ue4Pos.x, ue4Pos.y, ue4Pos.z)
|
|
|
+
|
|
|
})
|
|
|
window.points = response
|
|
|
})
|