Skip to content

Commit 34068b2

Browse files
committed
Make some changes for compatibility; rename setDefaults in Lights class to setBasic; correct some docs; move two more classes in extras to H3DU namespace
1 parent b37f144 commit 34068b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+353
-115
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ Example
7070
H3DU.renderLoop(function(time){
7171
// Update the shape's rotation
7272
var q=H3DU.Math.quatFromTaitBryan(
73-
360*H3DU.getTimePosition(timer,time,6000),
74-
360*H3DU.getTimePosition(timer,time,12000),
73+
360 * H3DU.getTimePosition(timer,time,6000),
74+
360 * H3DU.getTimePosition(timer,time,12000),
7575
0
7676
);
7777
shape.setQuaternion(q);

build/publish.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ function descriptions(nodes) {
259259
}
260260
desc = desc.replace(/^\s+/, "");
261261
desc = desc.replace(/\s+$/, "");
262+
desc = desc.replace(/\s+/, " ");
262263
if(desc.length > 0) {
263264
descriptions[node.longname] = desc;
264265
}

demos/animation-light.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<body>
1313
<canvas id=canvas></canvas>
1414
<script id="demo">
15-
/* global Animators, FrameCounterDiv, H3DU, createWasher, makeFloor, rotateVec */
15+
/* global Animators, H3DU, createWasher, makeFloor, rotateVec */
1616
// <!--
1717
/*
1818
Written by Peter O. in 2015.
@@ -39,7 +39,7 @@
3939
var shapecolors = ["white", "blue", "red", "green", "brown", "orange", "purple"];
4040
// Outer radius of each washer
4141
var shapesizes = [1, 0.9, 0.8, 0.7, 0.6, 0.7, 0.8];
42-
var fc = new FrameCounterDiv();
42+
var fc = new H3DU.FrameCounterDiv();
4343
var loader = new H3DU.TextureLoader();
4444
// load the floor texture
4545
loader.loadAndMapTexturesAll([

demos/animation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<body>
1313
<canvas id=canvas></canvas>
1414
<script id="demo">
15-
/* global Animators, FrameCounterDiv, H3DU, createWasher, makeFloor, rotateVec */
15+
/* global Animators, H3DU, createWasher, makeFloor, rotateVec */
1616
// <!--
1717
/*
1818
Written by Peter O. in 2015.
@@ -32,7 +32,7 @@
3232
var shapecolors = ["white", "blue", "red", "green", "brown", "orange", "purple"];
3333
// Outer radius of each washer
3434
var shapesizes = [1, 0.9, 0.8, 0.7, 0.6, 0.7, 0.8];
35-
var fc = new FrameCounterDiv();
35+
var fc = new H3DU.FrameCounterDiv();
3636
var loader = new H3DU.TextureLoader();
3737
// load the floor texture
3838
loader.loadAndMapTexturesAll([

demos/builtinshapes.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</p>
2929
<canvas id=canvas></canvas>
3030
<script id="demo">
31-
/* global FrameCounterDiv, H3DU */
31+
/* global H3DU */
3232
// <!--
3333
/*
3434
Written by Peter O. in 2015.
@@ -85,7 +85,7 @@
8585
var camera = new H3DU.Camera(sub, 45, 1, 1000).setDistance(5)
8686
.moveAngleVertical(-90);
8787
var xyz = new H3DU.ShapeGroup();
88-
var pc = new FrameCounterDiv();
88+
var pc = new H3DU.FrameCounterDiv();
8989
shape = null;
9090
var axisline = new H3DU.Shape(H3DU.Meshes.createCapsule(0.005, 10, 6, 4));
9191
var zaxis = axisline.copy().setColor("blue");

demos/clock.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</p>
1717
<canvas id=canvas></canvas>
1818
<script id="demo">
19-
/* global FrameCounterDiv, H3DU */
19+
/* global H3DU */
2020
// <!--
2121
/*
2222
Written by Peter O. in 2015.
@@ -119,7 +119,7 @@
119119
var sub = new H3DU.Batch3D();
120120
var camera = new H3DU.Camera(sub, 45, 1, 1000).setDistance(5);
121121
var input = new H3DU.InputTracker(scene.getCanvas());
122-
var pc = new FrameCounterDiv();
122+
var pc = new H3DU.FrameCounterDiv();
123123
var clock = new ClockShape(sub);
124124
document.getElementById("colorsetting").addEventListener("change",
125125
function(e) {

demos/curves.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<canvas id=canvas>
2020
</canvas>
2121
<script id="demo">
22-
/* global FrameCounterDiv, H3DU, addLink, makeMesh, pushSettings */
22+
/* global H3DU, addLink, makeMesh, pushSettings */
2323
// <!--
2424
/*
2525
Written by Peter O. in 2015.
@@ -166,7 +166,7 @@
166166
var sub = new H3DU.Batch3D();
167167
var camera = new H3DU.Camera(sub, 45, 1, 100);
168168
camera.setDistance(5);
169-
var pc = new FrameCounterDiv();
169+
var pc = new H3DU.FrameCounterDiv();
170170
link0();
171171
sub.addShape(shapeGroup);
172172
H3DU.renderLoop(function() {

demos/curvesexpr.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</div>
3838
<canvas id=canvas></canvas>
3939
<script id="demo">
40-
/* global FrameCounterDiv, H3DU, addRange, getExpression, updateShape */
40+
/* global H3DU, addRange, getExpression, updateShape */
4141
// <!--
4242
/*
4343
Written by Peter O. in 2015.
@@ -235,7 +235,7 @@
235235
scene.cullFace(H3DU.Scene3D.FRONT);
236236
var sub = new H3DU.Batch3D();
237237
var camera = new H3DU.Camera(sub, 45, 1, 100).setDistance(5);
238-
var pc = new FrameCounterDiv();
238+
var pc = new H3DU.FrameCounterDiv();
239239
link0();
240240
sub.addShape(shapeGroup);
241241
H3DU.renderLoop(function() {

demos/fallingballs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
var scene = new H3DU.Scene3D(document.getElementById("canvas"))
179179
.setClearColor("white");
180180
var sub = new H3DU.Batch3D();
181-
sub.getLights().setDefaults();
181+
sub.getLights().setBasic();
182182
sub.orthoAspect(0, 12, 0, 9, -5000, 5000);
183183
// 12 meters wide and 9 meters high
184184
var tris = new Particles(sub, 10, 12, 9);

demos/gradient.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</p>
1818
<canvas id=canvas></canvas>
1919
<script id="demo">
20-
/* global FrameCounterDiv, H3DU, Uint8Array */
20+
/* global H3DU, Uint8Array */
2121
// <!--
2222
/*
2323
Written by Peter O. in 2015.
@@ -117,8 +117,8 @@
117117
.perspectiveAspect(45, 0.1, 100)
118118
// Move the camera back 40 units.
119119
.setLookAt([0, 0, 40]);
120-
sub.getLights().setDefaults();
121-
var fc = new FrameCounterDiv();
120+
sub.getLights().setBasic();
121+
var fc = new H3DU.FrameCounterDiv();
122122
// Generate a red-blue gradient texture
123123
var tex = horizontalGradient("red", "blue");
124124
var mesh = H3DU.Meshes.createBox(10, 20, 20);

0 commit comments

Comments
 (0)