Skip to content

Commit 56822fb

Browse files
authored
Merge pull request #600 from redcamel/dev
-
2 parents 3c126b9 + b013151 commit 56822fb

File tree

8 files changed

+331
-68
lines changed

8 files changed

+331
-68
lines changed

example/baseTestUI.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,19 @@ baseTestUI.exampleList = [
165165
key: 'RedBasicController',
166166
href: 'camera/RedBasicController.html'
167167
},
168+
{
169+
key: 'RedBasicController_targetView',
170+
href: 'camera/RedBasicController_targetView.html'
171+
},
168172
{
169173
key: 'RedObitController',
170174
href: 'camera/RedObitController.html'
175+
},
176+
{
177+
key: 'RedObitController_targetView',
178+
href: 'camera/RedObitController_targetView.html'
171179
}
180+
172181
]
173182
},
174183
{
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<html>
2+
<head>
3+
<meta charset="UTF-8">
4+
<title>RedGL - RedBasicController_targetView</title>
5+
<meta name="apple-mobile-web-app-capable" content="yes"/>
6+
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
7+
<meta name="viewport"
8+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"
9+
/>
10+
<link rel="stylesheet" href="../example.css">
11+
12+
<script src="../dat.gui.min.js"></script>
13+
<script src="../baseTestUI.js"></script>
14+
<script src="../../release/RedGL.min.js"></script>
15+
</head>
16+
<body>
17+
<script id='testSource'>
18+
var testUI;
19+
var canvas;
20+
var assetPath = '../../asset/'
21+
canvas = document.createElement('canvas');
22+
document.body.appendChild(canvas);
23+
RedGL(canvas, function (v) {
24+
if (v) {
25+
console.log('초기화 성공!')
26+
var tWorld, tScene, tController, tController2, tRenderer;
27+
// 월드 생성
28+
this['world'] = tWorld = RedWorld();
29+
// 씬 생성
30+
tScene = RedScene(this);
31+
// 카메라 생성
32+
tController = RedBasicController(this);
33+
tController.x = tController.y = tController.z = 15
34+
tController.tilt = -45
35+
tController.pan = 45
36+
tController2 = RedBasicController(this);
37+
tController2.x = tController2.y = tController2.z = 15
38+
tController2.tilt = -45
39+
tController2.pan = 45
40+
console.log(tController)
41+
// 렌더러 생성
42+
tRenderer = RedRenderer();
43+
// 뷰생성 및 적용
44+
tWorld.addView(RedView('test', this, tScene, tController));
45+
tWorld.addView(RedView('test2', this, tScene, tController2));
46+
RedView('test').setSize('50%', '100%')
47+
RedView('test2').setSize('50%', '100%')
48+
RedView('test2').setLocation('50%', 0)
49+
tController['targetView'] = RedView('test');
50+
tController2['targetView'] = RedView('test2');
51+
// 그리드 설정
52+
tScene['grid'] = RedGrid(this)
53+
// axis 설정
54+
tScene['axis'] = RedAxis(this)
55+
// 렌더시작
56+
tRenderer.start(this, function (time) {
57+
58+
});
59+
// 렌더 디버거 활성화
60+
tRenderer.setDebugButton();
61+
//
62+
testUI(this, tController);
63+
} else {
64+
console.log('초기화 실패!')
65+
}
66+
});
67+
testUI = function (redGL, tController) {
68+
var gui = new baseTestUI(redGL);
69+
gui.initRedGL();
70+
};
71+
</script>
72+
</body>
73+
74+
</html>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<html>
2+
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>RedGL - RedObitController_targetView</title>
6+
<meta name="apple-mobile-web-app-capable" content="yes"/>
7+
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
8+
<meta name="viewport"
9+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"
10+
/>
11+
<link rel="stylesheet" href="../example.css">
12+
13+
<script src="../dat.gui.min.js"></script>
14+
<script src="../baseTestUI.js"></script>
15+
<script src="../../release/RedGL.min.js"></script>
16+
</head>
17+
18+
<body>
19+
<script id='testSource'>
20+
var testUI;
21+
var canvas;
22+
var assetPath = '../../asset/'
23+
canvas = document.createElement('canvas');
24+
document.body.appendChild(canvas);
25+
RedGL(canvas, function (v) {
26+
if (v) {
27+
console.log('초기화 성공!')
28+
var tWorld, tScene, tController, tController2, tRenderer;
29+
// 월드 생성
30+
this['world'] = tWorld = RedWorld();
31+
// 씬 생성
32+
tScene = RedScene(this);
33+
// 카메라 생성
34+
tController = RedObitController(this);
35+
tController.tilt = -45
36+
tController.pan = 45
37+
tController2 = RedObitController(this);
38+
tController2.tilt = -45
39+
tController2.pan = 45
40+
// 렌더러 생성
41+
tRenderer = RedRenderer();
42+
// 뷰생성 및 적용
43+
tWorld.addView(RedView('test', this, tScene, tController));
44+
tWorld.addView(RedView('test2', this, tScene, tController2));
45+
RedView('test').setSize('50%', '100%')
46+
RedView('test2').setSize('50%', '100%')
47+
RedView('test2').setLocation('50%', 0)
48+
tController['targetView'] = RedView('test');
49+
tController2['targetView'] = RedView('test2');
50+
// 그리드 설정
51+
tScene['grid'] = RedGrid(this)
52+
// axis 설정
53+
tScene['axis'] = RedAxis(this)
54+
// 렌더시작
55+
tRenderer.start(this, function (time) {
56+
})
57+
// 렌더 디버거 활성화
58+
tRenderer.setDebugButton();
59+
//
60+
testUI(this, tController)
61+
} else {
62+
console.log('초기화 실패!')
63+
}
64+
})
65+
testUI = function (redGL, tController) {
66+
console.log('test')
67+
var gui = new baseTestUI(redGL)
68+
gui.initRedGL()
69+
70+
}
71+
</script>
72+
</body>
73+
74+
</html>

0 commit comments

Comments
 (0)