Skip to content

Commit f66ca67

Browse files
committedFeb 13, 2025
Correct URL for GitHub gloss
1 parent ef54a14 commit f66ca67

File tree

5 files changed

+38
-8
lines changed

5 files changed

+38
-8
lines changed
 

‎.gitignore

-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@
44
/docs
55
/recordings
66
/output
7-
/old
8-
/todo.txt
9-
/bindings/gloss_py/examples/cam_control.py
10-
/bindings/gloss_py/examples/numpy_interop.py
11-
/bindings/gloss_py/examples/test.py
127
/bindings/gloss_py/gloss/*.so
138
/bindings/gloss_py/gloss/__pycache__
149
/bindings/gloss_py/gloss_py/*.so
1510
/bindings/gloss_py/gloss_py/__pycache__
1611
/bindings/gloss_py/*.png
1712
/node_modules
18-
README_old.md
1913
*.pyc
2014
*.pyi
2115
**/__pycache__/

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Gloss
22

3-
Gloss is a light-weight, Rust + wgpu-based renderer designed for rendering realistic appearances of human characters.
3+
Gloss is a light-weight Physically-based Renderer, written in Rust + wgpu
44

55
The main functionality includes loading meshes with high-resolution textures, rendering them with advanced graphics features, and allowing a general framework to explore new rendering techniques.
66
Gloss also compiles for Python and Web, allowing for rendering in multiple different environments.
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env python3
2+
"""
3+
This example shows how to create and control the gloss camera
4+
"""
5+
from gloss import Viewer, geom
6+
from gloss.log import LogLevel, gloss_setup_logger as setup_logger
7+
# Set up the logger
8+
# To be called only once per process. Can select between Off, Error, Warn, Info, Debug, Trace
9+
setup_logger(log_level = LogLevel.Info)
10+
11+
if __name__ == "__main__":
12+
# Create a Viewer instance and get the corresponding camera
13+
viewer = Viewer()
14+
cam = viewer.get_camera()
15+
16+
# Create an empty entity, attach a cube builder to it, and add to Visualiser scene
17+
# ``name`` is a unique identifier for an entity
18+
cube = viewer.get_or_create_entity(name = "Cube")
19+
cube.insert_builder(geom.build_cube(center = [0, 1.0, 0]))
20+
21+
# Set Camera parameters
22+
cam.set_position([1.0, 2.5, 5.0]) # xyz right-hand coordinate system
23+
cam.set_lookat([0.0, 1.0, 0.0])
24+
# or
25+
# cam.set_extrinsics(np.array([
26+
# [1.0, 0.0, 0.0, 0.0],
27+
# [0.0, 0.0, 1.0, 0.0],
28+
# [0.0, -1.0, 0.0, 8.0],
29+
# [0.0, 0.0, 0.0, 1.0]
30+
# ], dtype=np.float32))
31+
32+
# Make the camera orbit at a steady rate
33+
while True:
34+
dt = viewer.start_frame()
35+
cam.orbit_y(degrees = 10.0 * dt)
36+
viewer.update()

‎examples/view_mesh/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async fn create_test_scene(viewer: &mut Viewer) {
1818
let path_mesh = "./data/bust.obj";
1919
let path_diffuse = "./data/bust_alb.jpg";
2020
let path_normal = "./data/bust_nrm.png";
21-
let name = "SmplX_Avatar";
21+
let name = "default_mesh";
2222

2323
viewer
2424
.scene

‎imgs/mesh_view.png

184 KB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.