forked from xeolabs/scenejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
importing_3ds_lexus.html
96 lines (79 loc) · 3.48 KB
/
importing_3ds_lexus.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
<title>SceneJS Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
margin: 0;
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
}
</style>
<script src="../api/latest/scenejs.min.js"></script>
<link href="css/styles.css" rel="stylesheet"/>
<body>
<div id="infoDark">
<a href="http://scenejs.org">SceneJS</a> - <a href="../api/latest/plugins/node/import/3ds.js" target="_other">3DS</a> importer
<br>
learn more in <a href="http://xeolabs.com/articles/scenejs-obj-md2-3ds/" target="_other">this tutorial</a>
</div>
<script>
// Using the "import/3ds" node to import a Lexus car mesh from .3DS format
// Internally, the node uses the K3D library for parsing - http://k3d.ivank.net/
// Point SceneJS to the bundled plugins
SceneJS.setConfigs({
pluginPath: "../api/latest/plugins"
});
// Create a scene
SceneJS.createScene({
nodes: [
// Mouse-orbited camera,implemented by plugin at
// http://scenejs.org/api/latest/plugins/node/cameras/orbit.js
{
type: "cameras/orbit",
yaw: -40,
pitch: -20,
zoom: 100,
zoomSensitivity: 10.0,
nodes: [
// Rotate the Lexus
{
type: "rotate", x: 1, angle: -90,
nodes: [
// Texture our Lexus - the "import.3ds" node merely imports meshes, so
// it's our job to apply any materials and textures. This tends to be OK
// because for efficiency we would usually have one big baked texture
// like this one.
//
// Texture is loaded from:
// http://scenejs.org/examples/models/3ds/lexus.jpg
{
type: "texture",
src: "models/3ds/lexus.jpg",
nodes: [
// Import the .3DS mesh
//
// This node is implemented by plugin at:
// http://scenejs.org/api/latest/plugins/node/import/3ds.js
//
// The 3DS file is loaded from:
// http://scenejs.org/examples/models/3ds/lexus.3ds
{
type: "import/3ds",
src: "models/3ds/lexus.3ds"
}
]
}
]
}
]
}
]
}
);
</script>
</body>
</html>