https://github.com/bchao1/webgl-3d-viewer
3D model viewer in WebGL and pure Javascript.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.3%) to scientific vocabulary
Keywords
Repository
3D model viewer in WebGL and pure Javascript.
Statistics
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
3D Viewer
3D viewer in WebGL and pure Javascript.

Features
- Controllable Phong illumination model:
- Ambient intensity
- Diffuse intensity
- Specular intensity
- Specular order
- Controllable light source colors (currently 3 light sources)
- Controllable geometry:
- Translation
- Scaling
- Rotation
- 3D shear
- Controllable camera:
- FOV (field of view)
- Controllable models
- Toggle Y-axis rotation animation
Shadings
|Flat|Gouraud|Phong|
|--|--|--|
|
|
|
|
|
|
|
|
Phong illumination model
"Suzanne" a.k.a Blender Monkey.
|Ambient|Diffuse|Specular|Full|
|--|--|--|--|
|
|
|
|
|
|Low specular order (metal-like)|High specular order (glossy)|
|--|--|
|
|
|
Model transformations
"Stanford Bunny"
|Original|Rotate|Translate|Scale|Shear|
|--|--|--|--|--|
|
|
|
|
|
|
Using your own model
You can modify line 843,844 in index.html to use your own model. Concretely, comment out the predefined models modelNames = ["buddha", "teapot", "bunny", "suzanne"]; and change to modelNames = ["own"];. The program will load the ./src/model/Own.json file and render it.
To generate the Own.json file, modify input_obj_path and texture_path in the ./src/raw/obj2json.py script. The script loads a .obj file and (optinally) a texture atlas and outputs a processed json file to ./src/model/Own.json. Input models generated by this script are scaled and centered to fit a [-50, 50] box (aspect ratio kept).
Stanford "Happy Buddha"

Owner
- Name: Brian Chao
- Login: bchao1
- Kind: user
- Location: Stanford, California
- Company: Stanford University
- Website: https://bchao1.github.io
- Twitter: BrianCChao
- Repositories: 14
- Profile: https://github.com/bchao1
Stanford Ph.D. student. Research in computational photography, displays, and computer graphics. Open source enthusiast.
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0