We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2dc104 commit 89f716bCopy full SHA for 89f716b
1 file changed
content/examples/Basics/Shape/LoadDisplayOBJ/liveSketch.js
@@ -0,0 +1,27 @@
1
+function runLiveSketch(s) {
2
+ let rocketModel;
3
+ let rocketTexture;
4
+
5
+ s.preload = () => {
6
+ rocketModel = s.loadModel('/livesketch/loaddisplayobj/rocket.obj');
7
+ rocketTexture = s.loadImage('/livesketch/loaddisplayobj/rocket.png');
8
+ };
9
10
+ s.setup = () => {
11
+ s.createCanvas(640, 360, s.WEBGL);
12
+ s.noStroke();
13
+ s.describe(
14
+ 'a blue, white, and yellow rocket spins over a black background'
15
+ );
16
17
18
+ s.draw = () => {
19
+ s.background(0);
20
+ s.lights();
21
+ s.translate(0, 100, -200);
22
+ s.rotateZ(s.PI);
23
+ s.rotateY(s.frameCount * 0.02);
24
+ s.texture(rocketTexture);
25
+ s.model(rocketModel);
26
27
+}
0 commit comments