Rendering now occurs on load
This commit is contained in:
parent
4516cd57e7
commit
69593eb22c
|
@ -53,6 +53,7 @@ function onload()
|
||||||
{
|
{
|
||||||
gViewer = new Viewer(new CSG(), 600, 600, 5);
|
gViewer = new Viewer(new CSG(), 600, 600, 5);
|
||||||
document.getElementById("viewer").appendChild(gViewer.gl.canvas);
|
document.getElementById("viewer").appendChild(gViewer.gl.canvas);
|
||||||
|
updateSolid();
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSolid()
|
function updateSolid()
|
||||||
|
@ -103,7 +104,7 @@ function getStl()
|
||||||
<td><div id="viewer" class="viewer" style="background-image:none;width:600px;height:600px;"></div></td>
|
<td><div id="viewer" class="viewer" style="background-image:none;width:600px;height:600px;"></div></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<textarea id="code">var resolution = 24; // increase to get smoother corners (will get slow!)
|
<textarea id="code">var resolution = 16; // increase to get smoother corners (will get slow!)
|
||||||
|
|
||||||
var cube1 = CSG.roundedCube({center: [0,0,0], radius: [1,1,1], roundradius: 0.2, resolution: resolution});
|
var cube1 = CSG.roundedCube({center: [0,0,0], radius: [1,1,1], roundradius: 0.2, resolution: resolution});
|
||||||
var sphere1 = CSG.sphere({center: [0.5, 0.5, 0.5], radius: 1, resolution: resolution });
|
var sphere1 = CSG.sphere({center: [0.5, 0.5, 0.5], radius: 1, resolution: resolution });
|
||||||
|
|
Loading…
Reference in a new issue