Skip to content

Commit ca1668c

Browse files
committed
improve comments
1 parent be55950 commit ca1668c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

hybrid-programming/example4/example4.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
# Draw Torus Example
2+
#
3+
# Torus geometry algorithm adapted from Three.js (https://threejs.org/).
4+
# https://github.com/mrdoob/three.js/blob/dev/src/geometries/TorusGeometry.js
5+
16
import py5
27

3-
from peasy import PeasyCam
8+
# Import the PeasyCam library (a Java library, not a Python library)
9+
# PeasyCam was created by Jonathan Feinberg (https://mrfeinberg.com/peasycam/)
10+
# JPype lets you import Java libraries into Python as you would import a Python library
11+
from peasy import PeasyCam # type: ignore
412

513

614
torus = None

hybrid-programming/example4/java/src/main/java/py5utils/Py5Utilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public Py5Utilities(Sketch sketch) {
1414
}
1515

1616
public PShape createTorus(float radius, float tube, int radialSegments, int tubularSegments) {
17-
// Torus algorithm adapted from Three.js (https://threejs.org/).
17+
// Torus geometry algorithm adapted from Three.js (https://threejs.org/).
1818
// https://github.com/mrdoob/three.js/blob/dev/src/geometries/TorusGeometry.js
1919
float vertices[][] = new float[(radialSegments + 1) * (tubularSegments + 1)][3];
2020
for (int i = 0; i <= radialSegments; i++) {

0 commit comments

Comments
 (0)