-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathx3dom-0-empty.html
121 lines (97 loc) · 3.29 KB
/
x3dom-0-empty.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
layout: default
categories: [x3dom]
status: info
title: 'X3DOM : Empty'
---
<script src="http://x3dom.org/download/1.7.1/x3dom.js"></script>
<script>
var proxied = null;
function init_body()
{
x3dom.runtime.ready = function()
{
/* work around canvas extent dpi scale issue */
x3dom.canvases[0].canvas.width = parseInt( $('x3d').attr('width'));
x3dom.canvases[0].canvas.height = parseInt( $('x3d').attr('height'));
setupEval();
setupFirstFrame();
proxied = x3dom.canvases[0].tick;
x3dom.canvases[0].tick = function()
{
evalTick();
/* force x3dom canvas to rerender - no caching etc. */
x3dom.canvases[0].doc.needRender = true;
return proxied.apply( this, arguments );
};
/*x3dom.runtime.enterFrame = function()
{
evalTick();
};*/
/* remove hidden x3dom stats & logging */
$('#x3dom_logdiv').remove();
$('#x3dom-state-viewer').remove();
$('.x3dom-progress').remove();
$("x3d").find("shape").each(function()
{
$(this).attr("onmouseover", "highlightNode(this);");
$(this).attr("onmouseout", "unhighlightNode(this);");
});
};
}
function highlightNode(node)
{
if ($.isNumeric(node))
{
node = $("shape")[node];
}
var material = $(node).find("material");
material.attr("emissiveColor", material.attr("diffuseColor"));
}
function unhighlightNode(node)
{
if ($.isNumeric(node))
{
node = $("shape")[node];
}
var material = $(node).find("material");
material.attr("emissiveColor", "");
}
function numberOfItems()
{
console.log("Number of items not implemented.");
return -1;
}
function randomizeAllColorAttributes()
{
console.log("Randomization of color attributes not implemented.");
}
function randomizeAllHeightAttributes()
{
console.log("Randomization of height attributes not implemented.");
}
function highlight(index)
{
console.log("Highlighting of index node not implemented.");
}
function unhighlight(index)
{
console.log("Un-highlighting of index node not implemented.");
}
</script>
<X3D profile='Interchange' version='3.3' noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd' width="1110px" height="720px">
<Head>
</Head>
<Scene>
<!--<navigationInfo type='"turntable"' id="navType"></navigationInfo>-->
<viewpoint position="0 1.25 1.0" fieldofview="0.56" orientation="1.0 0.0 0.0 -0.93" centerofrotation="0,0,0" znear="0.02" zfar="16.0"> </viewpoint>
<transform id="transform-0" translation="0 0.002 0" scale="1 0.004 1">
<shape id="0">
<appearance>
<material id="color-0" diffuseColor="0.913725 0.913725 0.913725"/>
</appearance>
<box size="1 1 1"/>
</shape>
</transform>
</Scene>
</X3D>