forked from Rowland/EG
保存
This commit is contained in:
parent
fc7f0d55f3
commit
8a2f1f802c
BIN
Resources/models/Women_1.glb
Normal file
BIN
Resources/models/Women_1.glb
Normal file
Binary file not shown.
BIN
Resources/models/Women_2.glb
Normal file
BIN
Resources/models/Women_2.glb
Normal file
Binary file not shown.
BIN
Resources/models/women_1.glb
Normal file
BIN
Resources/models/women_1.glb
Normal file
Binary file not shown.
106
threejs_panel.html
Normal file
106
threejs_panel.html
Normal file
@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Three.js Panel</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
background: rgba(0,0,0,0.7);
|
||||
color: white;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
#info {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 100;
|
||||
}
|
||||
#canvas-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="info">
|
||||
<h3>场景信息面板</h3>
|
||||
<p>FPS: <span id="fps">0</span></p>
|
||||
<p>对象数: <span id="object-count">0</span></p>
|
||||
</div>
|
||||
<div id="canvas-container"></div>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
|
||||
<script>
|
||||
// 初始化Three.js场景
|
||||
let scene, camera, renderer;
|
||||
let cube;
|
||||
|
||||
function init() {
|
||||
// 创建场景
|
||||
scene = new THREE.Scene();
|
||||
|
||||
// 创建相机
|
||||
camera = new THREE.PerspectiveCamera(75,
|
||||
document.getElementById('canvas-container').offsetWidth /
|
||||
document.getElementById('canvas-container').offsetHeight,
|
||||
0.1, 1000);
|
||||
|
||||
// 创建渲染器
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
|
||||
renderer.setSize(
|
||||
document.getElementById('canvas-container').offsetWidth,
|
||||
document.getElementById('canvas-container').offsetHeight
|
||||
);
|
||||
document.getElementById('canvas-container').appendChild(renderer.domElement);
|
||||
|
||||
// 添加一个立方体
|
||||
const geometry = new THREE.BoxGeometry();
|
||||
const material = new THREE.MeshBasicMaterial({
|
||||
color: 0x00ff00,
|
||||
wireframe: true
|
||||
});
|
||||
cube = new THREE.Mesh(geometry, material);
|
||||
scene.add(cube);
|
||||
|
||||
camera.position.z = 5;
|
||||
|
||||
// 开始动画循环
|
||||
animate();
|
||||
|
||||
// 监听窗口大小变化
|
||||
window.addEventListener('resize', onWindowResize, false);
|
||||
}
|
||||
|
||||
function onWindowResize() {
|
||||
camera.aspect = document.getElementById('canvas-container').offsetWidth /
|
||||
document.getElementById('canvas-container').offsetHeight;
|
||||
camera.updateProjectionMatrix();
|
||||
renderer.setSize(
|
||||
document.getElementById('canvas-container').offsetWidth,
|
||||
document.getElementById('canvas-container').offsetHeight
|
||||
);
|
||||
}
|
||||
|
||||
function animate() {
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
// 旋转立方体
|
||||
cube.rotation.x += 0.01;
|
||||
cube.rotation.y += 0.01;
|
||||
|
||||
renderer.render(scene, camera);
|
||||
}
|
||||
|
||||
// 接收来自Python的消息
|
||||
function updateInfo(data) {
|
||||
document.getElementById('fps').textContent = data.fps || 0;
|
||||
document.getElementById('object-count').textContent = data.objectCount || 0;
|
||||
}
|
||||
|
||||
// 页面加载完成后初始化
|
||||
window.onload = init;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -632,6 +632,7 @@ class MainWindow(QMainWindow):
|
||||
# self.bottomDock.setWidget(self.fileView)
|
||||
# self.addDockWidget(Qt.BottomDockWidgetArea, self.bottomDock)
|
||||
|
||||
|
||||
# 创建底部停靠窗口(资源窗口)
|
||||
self.bottomDock = QDockWidget("资源", self)
|
||||
self.fileView = CustomAssetsTreeWidget(self.world)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user