File tree Expand file tree Collapse file tree 2 files changed +46
-1
lines changed
docs/yuidoc-p5-theme/assets Expand file tree Collapse file tree 2 files changed +46
-1
lines changed Original file line number Diff line number Diff line change
1
+ v 0 .000000E+00 0 .000000E+00 40.0000
2
+ v 22.5000 22.5000 0 .000000E+00
3
+ v 22.5000 -22.5000 0 .000000E+00
4
+ v -22.5000 -22.5000 0 .000000E+00
5
+ v -22.5000 22.5000 0 .000000E+00
6
+ v 0 .000000E+00 0 .000000E+00 -40.0000
7
+
8
+ f 1 2 3
9
+ f 1 3 4
10
+ f 1 4 5
11
+ f 1 5 2
12
+ f 6 5 4
13
+ f 6 4 3
14
+ f 6 3 2
15
+ f 6 2 1
16
+ f 6 1 5
Original file line number Diff line number Diff line change @@ -35,11 +35,38 @@ require('./p5.Geometry');
35
35
* @example
36
36
* <div>
37
37
* <code>
38
+ * //draw a spinning octahedron
39
+ * var octahedron;
40
+ *
41
+ * function preload() {
42
+ * octahedron = loadModel('assets/octahedron.obj');
43
+ * }
44
+ *
45
+ * function setup() {
46
+ * createCanvas(100, 100, WEBGL);
47
+ * }
48
+ *
49
+ * function draw() {
50
+ * background(200);
51
+ * rotateX(frameCount * 0.01);
52
+ * rotateY(frameCount * 0.01);
53
+ * model(octahedron);
54
+ * }
55
+ * </code>
56
+ * </div>
57
+ *
58
+ * @alt
59
+ * Vertically rotating 3-d octahedron.
60
+ *
61
+ * @example
62
+ * <div>
63
+ * <code>
38
64
* //draw a spinning teapot
39
65
* var teapot;
40
66
*
41
67
* function preload() {
42
- * teapot = loadModel('assets/teapot.obj');
68
+ * // Load model with normalise parameter set to true
69
+ * teapot = loadModel('assets/teapot.obj', true);
43
70
* }
44
71
*
45
72
* function setup() {
@@ -48,8 +75,10 @@ require('./p5.Geometry');
48
75
*
49
76
* function draw() {
50
77
* background(200);
78
+ * scale(0.4); // Scaled to make model fit into canvas
51
79
* rotateX(frameCount * 0.01);
52
80
* rotateY(frameCount * 0.01);
81
+ * normalMaterial(); // For effect
53
82
* model(teapot);
54
83
* }
55
84
* </code>
You can’t perform that action at this time.
0 commit comments