Platform
Solutions
Resources
Pricing
Sign in
Sign up
sw1227
Vis / Geo / Generative / Simulation / AI / Math 🥑 Portfolio: https://sw1227.github.io/portfolio
Workspace
Fork
Published
Generative
By
sw1227
Edited
Mar 8, 2020
1 fork
2 stars
Insert cell
Insert cell
createREGL
=
require
(
'https://unpkg.com/regl@1.3.1/dist/regl.min.js'
)
Insert cell
function
createGL
(
opts
)
{
var
canvas
=
html
`<canvas width="960" height="600">`
var
regl
=
createREGL
(
Object
.
assign
(
{
canvas
:
canvas
}
,
opts
||
{
}
)
)
return
{
canvas
,
regl
}
}
Insert cell
gl
=
createGL
(
)
Insert cell
Insert cell
Insert cell
Insert cell
cmd
=
gl
.
regl
(
{
vert
:
vertexShader
,
frag
:
fragmentShader
,
attributes
:
{
a_vertex
:
[
[
-
1
,
-
1
]
,
[
+
1
,
-
1
]
,
[
+
1
,
+
1
]
,
[
-
1
,
+
1
]
]
,
}
,
uniforms
:
{
u_size
:
gl
.
canvas
.
width
,
u_time
:
gl
.
regl
.
prop
(
"u_time"
)
}
,
primitive
:
"triangle fan"
,
count
:
4
}
)
Insert cell
function
draw
(
t
)
{
gl
.
regl
.
clear
(
{
color
:
[
0
,
0
,
0
,
1
]
}
)
cmd
(
{
u_time
:
t
}
)
}
Insert cell
draw
(
(
now
%
100000
)
/
1000
)
Insert cell
One platform
to build and deploy the best data apps
Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
createREGL
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
createGL
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
gl
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
fragmentShader
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
vertexShader
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cmd
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
draw
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML