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
CAP 4720 2021
Parametric curve
CAP 4720: Introduction to Observable
Useful Javascript Array functions.
Vectors and vector Algebra
Example Use of TWGL Math Library
Intro to WebGL Programming using twgl.
Point In front or back of A Plane
Rasterization & Interpolation
Barycentric Coordinates
Model Loaders using ThreeJS
Diffuse lighting: Lambert Cosine Model.
Shade Due to Diffuse Lighting
Orbit Camera
SpotLight and its effect in Lighting.
Normal Matrix
Specular lighting Model
Diffuse + Specular + Ambient Lighting
WebGL Texturing using twgl.
WebGL/twgl Rendering of Multipart Model with Texture
Skybox rendering using Cubemap.
Stenciling Example
Silhouette Edge
Shadow Projection of 3D Objects
Fragment Inside/Outside Volume
Inbeweening using Tween.js: 1
Rotations
Ray-Scene (2D) intersection
Rotor Quaternion
SLERP: Spherical Linear Interpolation
Also listed in…
Computer Graphics Fundamentals
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