diff --git a/coffee/generator.coffee b/coffee/generator.coffee index cafd377..82e4d13 100644 --- a/coffee/generator.coffee +++ b/coffee/generator.coffee @@ -15,8 +15,8 @@ class Generator extends Gear super face createMesh: -> - @mesh = new THREE.Mesh Geom.gear(), Cage.cageMat - @mesh.add new THREE.Mesh Geom.generator(), Cage.rasterMat + @mesh = new THREE.Mesh Geom.generator(), Cage.cageMat + # @mesh.add new THREE.Mesh Geom.gear(), Cage.rasterMat @mesh.receiveShadow = true activateWires: -> diff --git a/coffee/geom.coffee b/coffee/geom.coffee index 73b708e..e1f2396 100644 --- a/coffee/geom.coffee +++ b/coffee/geom.coffee @@ -21,14 +21,14 @@ class Geom pi = @quadStrip positions, normals, pi, @generatorQuadStrip2 pi = @quadStrip positions, normals, pi, @generatorQuadStrip3 pi = @quadStrip positions, normals, pi, @generatorQuadStrip4 - pi = @quadStrip positions, normals, pi, @generatorQuadStrip5 - pi = @quadStrip positions, normals, pi, @generatorQuadStrip6 - pi = @quadStrip positions, normals, pi, @generatorQuadStrip7 - pi = @quadStrip positions, normals, pi, @generatorQuadStrip8 - pi = @quadStrip positions, normals, pi, @generatorQuadStrip9 - pi = @quadStrip positions, normals, pi, @generatorQuadStrip10 - pi = @quadStrip positions, normals, pi, @generatorQuadStrip11 - pi = @quadStrip positions, normals, pi, @generatorQuadStrip12 + # pi = @quadStrip positions, normals, pi, @generatorQuadStrip5 + # pi = @quadStrip positions, normals, pi, @generatorQuadStrip6 + # pi = @quadStrip positions, normals, pi, @generatorQuadStrip7 + # pi = @quadStrip positions, normals, pi, @generatorQuadStrip8 + # pi = @quadStrip positions, normals, pi, @generatorQuadStrip9 + # pi = @quadStrip positions, normals, pi, @generatorQuadStrip10 + # pi = @quadStrip positions, normals, pi, @generatorQuadStrip11 + # pi = @quadStrip positions, normals, pi, @generatorQuadStrip12 geom = new THREE.BufferGeometry geom.addAttribute 'position', new THREE.BufferAttribute positions, 3 @@ -144,18 +144,18 @@ class Geom 0, 0, 1, 0, 0.100, 0.500, 0, 0, 1,-0.071, 0.071, 0.500, 0, 0, 1, 0, -0.100, 0.500, - 0, 0, -1, 0.100, 0, -0.500, - 0, 0, -1, 0.071, -0.071, -0.500, - 0, 0, -1, 0, -0.100, -0.500, - 0, 0, -1, 0.071, 0.071, -0.500, - 0, 0, -1,-0.100, 0, -0.500, - 0, 0, -1,-0.071, 0.071, -0.500, - 0, 0, -1, 0, 0.100, -0.500, - 0, 0, -1,-0.071, -0.071, -0.500, - 0, 0, -1, 0.071, 0.071, -0.500, - 0, 0, -1, 0, -0.100, -0.500, - 0, 0, -1,-0.071, -0.071, -0.500, - 0, 0, -1, 0, 0.100, -0.500, + 0, 0, -1, 0.2, 0, -0.076, + 0, 0, -1, 0.141, -0.141, -0.076, + 0, 0, -1, 0, -0.2, -0.076, + 0, 0, -1, 0.141, 0.141, -0.076, + 0, 0, -1,-0.2, 0, -0.076, + 0, 0, -1,-0.141, 0.141, -0.076, + 0, 0, -1, 0, 0.2, -0.076, + 0, 0, -1,-0.141, -0.141, -0.076, + 0, 0, -1, 0.141, 0.141, -0.076, + 0, 0, -1, 0, -0.2, -0.076, + 0, 0, -1,-0.141, -0.141, -0.076, + 0, 0, -1, 0, 0.2, -0.076, ] @generatorQuadStrip1 = [ @@ -177,8 +177,6 @@ class Geom 0, 1, 0, 0, 0.200, 0.078, 0.707, 0.707, 0, 0.141, 0.141, -0.076, 0.707, 0.707, 0, 0.141, 0.141, 0.078, - 1, 0, 0, 0.200, 0, -0.076, - 1, 0, 0, 0.200, 0, 0.078 ] @generatorQuadStrip2 = [ 0, 0.710, 0.704, 0, 0.200, 0.078, @@ -199,8 +197,6 @@ class Geom -0.502, 0.502, 0.704, -0.042, 0.042, 0.220, 0, 0.710, 0.704, 0, 0.200, 0.078, 0, 0.710, 0.704, 0, 0.059, 0.220, - 0.502, 0.502, 0.704, 0.141, 0.141, 0.078, - 0.502, 0.502, 0.704, 0.042, 0.042, 0.220 ] @generatorQuadStrip3 = [ 0, 1, 0, 0, 0.100, 0.354, @@ -221,8 +217,6 @@ class Geom -0.707, 0.707, 0, -0.071, 0.071, 0.500, 0, 1, 0, 0, 0.100, 0.354, 0, 1, 0, 0, 0.100, 0.500, - 0.707, 0.707, 0, 0.071, 0.071, 0.354, - 0.707, 0.707, 0, 0.071, 0.071, 0.500 ] @generatorQuadStrip4 = [ 0.676, 0.676, -0.291, 0.042, 0.042, 0.220, @@ -243,8 +237,6 @@ class Geom 0, 0.957, -0.291, 0, 0.100, 0.354, 0.676, 0.676, -0.291, 0.042, 0.042, 0.220, 0.676, 0.676, -0.291, 0.071, 0.071, 0.354, - 0.957, 0, -0.291, 0.059, 0, 0.220, - 0.957, 0, -0.291, 0.100, 0, 0.354 ] @generatorQuadStrip5 = [ 0.756, 0.295, 0.585, -0.044, -0.498, 0.155, diff --git a/coffee/levels/test.coffee b/coffee/levels/test.coffee index e8ee725..bff4e0e 100644 --- a/coffee/levels/test.coffee +++ b/coffee/levels/test.coffee @@ -19,10 +19,10 @@ module.exports = s = world.size {Gear,Generator,MotorCylinder,MotorGear,Face} = require '../items' - # world.addObjectAtPos new Generator(Face.NZ), 5, 5, 0 - # world.addObjectAtPos new Generator(Face.NZ), 5, 5, 10 - world.addObjectAtPos new Gear(Face.NZ), 6, 5, 0 - world.addObjectAtPos new Gear(Face.Z), 4, 5, 0 + world.addObjectAtPos new Generator(Face.NX), 4, 5, 0 + world.addObjectAtPos new Generator(Face.X), 6, 5, 0 + # world.addObjectAtPos new Gear(Face.NZ), 6, 5, 0 + # world.addObjectAtPos new Gear(Face.Z), 4, 5, 0 return world.addObjectAtPos new Gear(Face.Z), 4, 5, 0 world.addObjectAtPos new Gear(Face.Z), 5, 6, 0 diff --git a/coffee/world.coffee b/coffee/world.coffee index 4a1e34f..170154c 100644 --- a/coffee/world.coffee +++ b/coffee/world.coffee @@ -61,7 +61,7 @@ class World extends Actor super - @noRotations = false + @noRotations = true @screenSize = new Size @view.clientWidth, @view.clientHeight # log "view @screenSize:", @screenSize