Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash label:bug #32

Open
ghost opened this issue Jul 12, 2016 · 1 comment
Open

Crash label:bug #32

ghost opened this issue Jul 12, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 12, 2016

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>3D ROOM</title>
  <link rel="stylesheet" href="style.css">
<!--</head>-->
  </head>
<body>
<script src="script.js"></script>
<script>
var scene;
var world;
var color = "#ffeb3b";
function graph(x,y,z) {
    var voxel = new voxelcss.Voxel(x*50, y*50, z*50, 50, {
      mesh: new voxelcss.Mesh(new voxelcss.ColorFace(color))
    });
    world.add(voxel);
    voxel.addEventListener("VoxelClick",function() {alert();});
}
function init(element) {
  var PI          = Math.PI;
  scene       = new voxelcss.Scene();
  var lightSource = new voxelcss.LightSource(300, 300, 300, 750, 0.3, 1);
  world       = new voxelcss.World(scene);
  scene.rotate(-PI / 8, PI / 4, 0);
  scene.attach(element);
  scene.addLightSource(lightSource);
    for(x=0;x<=100;x++) {
        for(z=0;z<=100;z++) {graph(x,0,z);}
        graph(x,100,100);
        graph(x,100,0);
    }
    for(y=0;y<=100;y++) {
        graph(0,y,0);
        graph(100,y,0);
        graph(0,y,100);
        graph(100,y,100);
    }
    for (z=0; z<=100; z++) {
        graph(0,100,z);
        graph(100,100,z);
    }
}
init(document.body); </script>
</body>
</html>

Try this. It crashes the browser.

@ghost
Copy link
Author

ghost commented Jul 12, 2016

So, it's not good for games.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants