Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F887302
test_scene.html
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
test_scene.html
View Options
<
html
xmlns:v
=
"urn:schemas-microsoft-com:vml"
xmlns:o
=
"urn:schemas-microsoft-com:office:office"
>
<
head
>
<
title
>
Scene test of dojox.gfx3d.
</
title
>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=utf-8"
/>
<
style
type
=
"text/css"
>
@
import
"../../../dojo/resources/dojo.css"
;
@
import
"../../../dijit/tests/css/dijitTests.css"
;
</
style
>
<
script
type
=
"text/javascript"
src
=
"../../../dojo/dojo.js"
djConfig
=
"isDebug: true"
></
script
>
<
script
type
=
"text/javascript"
>
dojo
.
require
(
"dojox.gfx3d"
);
var
view
=
null
;
makeObjects
=
function
(){
var
surface
=
dojox
.
gfx
.
createSurface
(
"test"
,
500
,
500
);
view
=
surface
.
createViewport
();
var
c
=
{
bottom
:
{
x
:
0
,
y
:
0
,
z
:
0
},
top
:
{
x
:
100
,
y
:
100
,
z
:
100
}};
var
m
=
dojox
.
gfx3d
.
matrix
;
var
sc1
=
view
.
createScene
();
sc1
.
createCube
(
c
).
setStroke
({
color
:
"blue"
,
width
:
1
});
var
sc2
=
view
.
createScene
();
sc2
.
createCube
(
c
).
setStroke
({
color
:
"red"
,
width
:
1
}).
setFill
(
"lime"
);
var
poly
=
[{
x
:
0
,
y
:
0
,
z
:
0
},
{
x
:
0
,
y
:
100
,
z
:
0
},
{
x
:
100
,
y
:
100
,
z
:
0
},
{
x
:
100
,
y
:
0
,
z
:
0
}];
sc2
.
createPolygon
(
poly
)
.
setStroke
({
color
:
"blue"
,
width
:
1
})
.
setTransform
(
dojox
.
gfx3d
.
matrix
.
translate
(
50
,
20
,
30
))
.
setFill
(
"yellow"
);
sc2
.
setTransform
(
dojox
.
gfx3d
.
matrix
.
translate
(
100
,
200
,
30
))
var
camera
=
dojox
.
gfx3d
.
matrix
.
normalize
([
m
.
cameraRotateXg
(
30
),
m
.
cameraRotateYg
(
60
),
m
.
cameraTranslate
(
0
,
0
,
0
)
]);
view
.
applyCameraTransform
(
camera
);
view
.
render
();
// set up the click handlers.
dojo
.
connect
(
dojo
.
byId
(
"rotate"
),
"onclick"
,
rotate
);
};
rotate
=
function
()
{
view
.
applyCameraTransform
(
dojox
.
gfx3d
.
matrix
.
rotateXg
(
10
));
view
.
invalidate
();
view
.
render
();
};
dojo
.
addOnLoad
(
makeObjects
);
</
script
>
</
head
>
<
body
>
<
h1
>
Scene Test
</
h1
>
<
p
>
Test the setTransform of the Scene. the lime cube and yellow polygon are grouped in one Scene, and they are moved in one shot.
</
p
>
<
p
>
Test Viewport.invalidate with Scene.
<
input
id
=
"rotate"
type
=
"button"
value
=
"Rotate around Z-Axis"
/></
p
>
<
div
id
=
"test"
style
=
"width: 500px; height: 500px;"
></
div
>
<
p
>
That's all Folks!
</
p
>
</
body
>
</
html
>
File Metadata
Details
Attached
Mime Type
text/html
Expires
Mon, Apr 7, 11:43 (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26855
Default Alt Text
test_scene.html (2 KB)
Attached To
rZED Zed
Event Timeline
Log In to Comment