|
@@ -21,16 +21,22 @@ export class CaseBabylonPage implements OnInit {
|
|
|
|
|
|
CharacterMap:any = {}
|
|
|
CharacterMeshList = [
|
|
|
- {
|
|
|
- name:"机器人",
|
|
|
- dirPath:"assets/3dmodel/robot_rk11/",
|
|
|
- filePath:"scene.gltf"
|
|
|
- },
|
|
|
- {
|
|
|
- name:"卡通人",
|
|
|
- dirPath:"assets/3dmodel/vtuber/",
|
|
|
- filePath:"scene.gltf"
|
|
|
- }
|
|
|
+ {name:"古风少女",
|
|
|
+ dirPath:"https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/3d/model/ancient-chinese-woman/gltf/",
|
|
|
+ filePath:"scene.gltf"},
|
|
|
+ {name:"中国象棋",
|
|
|
+ dirPath:"https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/3d/model/chinese-chess/gltf/",
|
|
|
+ filePath:"scene.gltf"},
|
|
|
+ {name:"卡通异瞳少女",
|
|
|
+ dirPath:"https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/3d/model/vtuber-selen/gltf/",
|
|
|
+ filePath:"scene.gltf"},
|
|
|
+ {name:"中国老杯子",
|
|
|
+ dirPath:"https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/3d/model/chinese-iron-cup/",
|
|
|
+ filePath:"scene.gltf"},
|
|
|
+ {name:"中国城市lowpoly",
|
|
|
+ dirPath:"https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/3d/model/chinese-city-lowpoly/gltf/",
|
|
|
+ filePath:"scene.gltf"},
|
|
|
+
|
|
|
]
|
|
|
constructor() { }
|
|
|
|
|
@@ -56,7 +62,8 @@ export class CaseBabylonPage implements OnInit {
|
|
|
|
|
|
// 设置初始相机
|
|
|
// Add an ArcRotateCamera to the scene and attach it to the canvas
|
|
|
- let initPositon = new BABYLON.Vector3(0,12,0)
|
|
|
+ // let initPositon = new BABYLON.Vector3(0,12,0)
|
|
|
+ let initPositon = new BABYLON.Vector3(0,0,0)
|
|
|
let beta = Math.PI / 2.5 // 镜头初始 纬度 Math.PI / 3 斜下45度
|
|
|
let radius = 20 // 镜头初始半径
|
|
|
const camera = new BABYLON.ArcRotateCamera('camera1', Math.PI / 2, beta, radius, initPositon, this.scene);
|
|
@@ -89,6 +96,9 @@ export class CaseBabylonPage implements OnInit {
|
|
|
this.scene?.render();
|
|
|
});
|
|
|
|
|
|
+ // 开启调试层,用于抓取角度
|
|
|
+ this.scene.debugLayer.show();
|
|
|
+
|
|
|
// Watch for browser/canvas resize events
|
|
|
window.addEventListener('resize', () => {
|
|
|
this.engine?.resize();
|