Skip to content

Commit d245d5a

Browse files
committed
Add second example to loadModel
1 parent 5944b1f commit d245d5a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/webgl/loading.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,35 @@ require('./p5.Geometry');
5757
*
5858
* @alt
5959
* Vertically rotating 3-d teapot octahedron.
60+
*
61+
* @example
62+
* <div>
63+
* <code>
64+
* //draw a spinning teapot
65+
* var teapot;
66+
*
67+
* function preload() {
68+
* // Load model with normalise parameter set to true
69+
* teapot = loadModel('assets/teapot.obj', true);
70+
* }
71+
*
72+
* function setup() {
73+
* createCanvas(100, 100, WEBGL);
74+
* }
75+
*
76+
* function draw() {
77+
* background(200);
78+
* scale(0.4); // Scaled to make model fit into canvas
79+
* rotateX(frameCount * 0.01);
80+
* rotateY(frameCount * 0.01);
81+
* normalMaterial(); // For effect
82+
* model(teapot);
83+
* }
84+
* </code>
85+
* </div>
86+
*
87+
* @alt
88+
* Vertically rotating 3-d teapot with red, green and blue gradient.
6089
*/
6190
/**
6291
* @method loadModel

0 commit comments

Comments
 (0)