Skip to content

Commit e7f1955

Browse files
authored
Merge pull request #585 from redcamel/V3.6.0-Alpha-rnd
#582 으어....빡셌다
2 parents a25c4f7 + 7cd5610 commit e7f1955

4 files changed

Lines changed: 68 additions & 0 deletions

File tree

examples/exampleHelper/exampleList/exampleList.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,14 @@ Check performance limits on each device.`
15661566
ko: ``,
15671567
en: ``
15681568
},
1569+
}, {
1570+
name: 'texcooredNTest',
1571+
path: 'gltf/models/texcooredNTest',
1572+
thumb: 'gltf/models/texcooredNTest/thumb.png',
1573+
description: {
1574+
ko: ``,
1575+
en: ``
1576+
},
15691577
},
15701578
]
15711579
},
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta content="width=device-width, initial-scale=1.0" name="viewport">
6+
7+
<link href="../../../exampleHelper/createExample/example.css" rel="stylesheet"/>
8+
<script src="index.js" type="module"></script>
9+
<script src="../../../exampleHelper/createExample/loadExampleInfo/index.js" type="module"></script>
10+
</head>
11+
<body>
12+
</body>
13+
</html>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import * as RedGPU from "../../../../dist/index.js";
2+
3+
const canvas = document.createElement('canvas');
4+
document.body.appendChild(canvas);
5+
6+
RedGPU.init(
7+
canvas,
8+
(redGPUContext) => {
9+
const controller = new RedGPU.Camera.OrbitController(redGPUContext);
10+
11+
controller.tilt = 0
12+
13+
const scene = new RedGPU.Display.Scene();
14+
const view = new RedGPU.Display.View3D(redGPUContext, scene, controller);
15+
redGPUContext.addView(view);
16+
loadGLTF(view, 'https://threejs.org/examples/models/gltf/Soldier.glb');
17+
const renderer = new RedGPU.Renderer(redGPUContext);
18+
const render = () => {
19+
};
20+
renderer.start(redGPUContext, render);
21+
22+
renderTestPane(redGPUContext, view);
23+
},
24+
(failReason) => {
25+
console.error('RedGPU initialization failed:', failReason);
26+
const errorDiv = document.createElement('div');
27+
errorDiv.innerHTML = failReason;
28+
document.body.appendChild(errorDiv);
29+
}
30+
);
31+
32+
function loadGLTF(view, url) {
33+
const {redGPUContext, scene} = view;
34+
new RedGPU.GLTFLoader(redGPUContext, url, (result) => {
35+
const mesh = result.resultMesh
36+
view.camera.fitMeshToScreenCenter(mesh, view)
37+
scene.addChild(mesh)
38+
});
39+
}
40+
41+
const renderTestPane = async (redGPUContext, targetView) => {
42+
const {Pane} = await import('https://cdn.jsdelivr.net/npm/[email protected]/dist/tweakpane.min.js');
43+
const {createIblHelper, setDebugButtons} = await import('../../../exampleHelper/createExample/panes/index.js');
44+
setDebugButtons(redGPUContext);
45+
const pane = new Pane();
46+
createIblHelper(pane, targetView, RedGPU);
47+
};
75.4 KB
Loading

0 commit comments

Comments
 (0)