Platform
Resources
Pricing
Sign in
Contact us
Sumant Pattanaik
Workspace
Fork
Public
2 collections
By
Sumant Pattanaik
Edited
Oct 17, 2024
ISC
Fork of
WebGL Texture in REGL
•
1 fork
Importers
3 stars
2
Computer Graphics Fundamentals
Vectors and vector Algebra
Rotations
Normal Matrix
Useful Javascript Array functions.
CAP 4720: Introduction to Observable
Barycentric Coordinates
Rasterization & Interpolation
Basic WebGL Programming Using REGL
Diffuse lighting: Lambert Cosine Model.
Specular lighting Model
Shade Due to Diffuse Lighting
SpotLight and its effect in Lighting.
WebGL Texture in REGL
WebGL/twgl Rendering of Multipart Model with Texture
Normal mapping
Blending Example
Stenciling Example
Model Loader, Viewer
Point In front or back of A Plane
Silhouette Edge
Rotor Quaternion
Fragment Inside/Outside Volume
SLERP: Spherical Linear Interpolation
Instancing in Regl
Color from Wavelength, Correlated Temperature and HTML color picker
HSV and HSL Color Models
Parametric curve
CAP 4720 Final Project List
OBJ Parser: obj2sc
Ray-Box intersection
Ray
Ray-Sphere (in 2D) intersection
Ray-Scene (2D) intersection
Uniform Grid Acceleration
Scaled Objects from OBJ models
Skybox rendering using Cubemap.
WebGL Texturing using twgl.
Also listed in…
CAP 4720 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
attributes
=
(
{
position
:
{
numComponents
:
2
,
data
:
quadData
.
positions
.
flat
(
)
}
,
uv
:
{
numComponents
:
2
,
data
:
quadData
.
uvs
.
flat
(
)
}
,
indices
:
quadData
.
cells
.
flat
(
)
}
)
Insert cell
bufferInfo
=
twgl
.
createBufferInfoFromArrays
(
gl
,
attributes
)
Insert cell
uniforms
=
(
{
tex
:
texture
,
aspectRatio
}
)
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
imageURL
=
FileAttachment
(
"cubetexture.png"
)
.
url
(
)
Insert cell
image
=
image_from_URL
(
imageURL
)
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.
Insert cell
Insert cell
Insert cell
texture1
=
twgl
.
createTexture
(
gl
,
{
// see more info on options from: https://twgljs.org/docs/module-twgl.html#.TextureOptions
// Also see https://twgljs.org/docs/
src
:
image
,
flipY
:
true
,
wrap
:
gl
[
textureOptions
.
wrap
.
toUpperCase
(
)
]
,
mag
:
gl
[
textureOptions
.
magfilter
.
toUpperCase
(
)
]
,
min
:
gl
[
textureOptions
.
minfilter
.
toUpperCase
(
)
]
}
)
Insert cell
Insert cell
Insert cell
Insert cell
url
=
"https://raw.githubusercontent.com/mdn/webgl-examples/gh-pages/tutorial/sample6/cubetexture.png"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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
Listed in...
CAP 4720 2021
Sumant Pattanaik
Computer Graphics Fundamentals
Sumant Pattanaik
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
textureScale
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
textureOptions
Edit
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
gl
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
errorBlock
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
programInfo
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
shaders
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
attributes
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
bufferInfo
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
uniforms
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
quadData
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
aspectRatio
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
canvasWidth
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
canvasHeight
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
imageURL
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
image
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
texture
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
texture1
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
anotherTexture
Edit
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
url
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
image_from_URL
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
testurl
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cubemap
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cubeimagesCroppedFromHCrossShape
Edit
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
twgl
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML