Platform
Resources
Pricing
Sign in
Get started
Claudio Esperança
Computer Graphics & Visualization @ufrj.br
Workspace
Fork
Published
By
Claudio Esperança
Edited
Mar 28, 2019
Fork of
Hello, Three.js Orbit Controls!
•
2 forks
1 star
Insert cell
Insert cell
Insert cell
Insert cell
scene
=
{
const
scene
=
new
THREE
.
Scene
(
)
;
scene
.
background
=
new
THREE
.
Color
(
0xffffff
)
;
scene
.
add
(
cube
)
;
return
scene
;
}
Insert cell
Insert cell
cube
=
{
const
material
=
new
THREE
.
MeshNormalMaterial
(
)
;
const
geometry
=
new
THREE
.
BoxGeometry
(
1
,
1
,
1
)
;
return
new
THREE
.
Mesh
(
geometry
,
material
)
;
}
Insert cell
Insert cell
camera
=
{
const
fov
=
45
;
const
aspect
=
width
/
height
;
const
near
=
1
;
const
far
=
1000
;
const
camera
=
new
THREE
.
PerspectiveCamera
(
fov
,
aspect
,
near
,
far
)
;
camera
.
position
.
set
(
2
,
2
,
-
2
)
camera
.
lookAt
(
new
THREE
.
Vector3
(
0
,
0
,
0
)
)
;
return
camera
;
}
Insert cell
Insert cell
height
=
~
~
(
width
*
3
/
4
)
Insert cell
Insert cell
THREE
=
{
const
THREE
=
window
.
THREE
=
await
require
(
"three@0.96/build/three.min.js"
)
;
await
require
(
"three@0.96/examples/js/controls/OrbitControls.js"
)
.
catch
(
(
)
=>
{
}
)
;
return
THREE
;
}
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
scene
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cube
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
camera
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
height
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
THREE
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML