Butterwell

Members
  • Content count

    16
  • Joined

  • Last visited

About Butterwell

  • Rank
    Member

Recent Profile Visitors

283 profile views
  1. Butterwell

    Best performing material/light combinaton

    This *may* be standard for the ANGLE driver, since it's not a "real" driver but a shim/translator to Direct 11 calls.
  2. Butterwell

    Shape support or...

    Thank you. Good to be here.
  3. Butterwell

    Shape support or...

    Got it to work. http://www.babylonjs-playground.com/#9BWQ4C The meat of the solution: var r1 = 3; // inner radius var r2 = 5; // outer radius var segments = 4; var points = segments + 1; var arc1 = []; var arc2 = []; var radians = Math.PI for (var i = 0; i < points; i++) { arc1.push(new BABYLON.Vector3(r1*Math.cos(radians*i/segments), r1*Math.sin(radians*i/segments), 0)); arc2.push(new BABYLON.Vector3(r2*Math.cos(radians*i/segments), r2*Math.sin(radians*i/segments), 0)); }
  4. Butterwell

    Shape support or...

    The "obvious" answer (now) is "use a ribbon". Working on it.
  5. Butterwell

    Shape support or...

    I've got some code in THREE.js that uses the Shape abstraction. I haven't been able to figure out how to do a similar thing in Babylon.js at this level of abstraction. My code does thus to create a fat arc (a 2D geometry/mesh): function fatArcGeometry(bandWidth, radius, radians) { const outerRadius = radius + (bandWidth/2) const innerRadius = radius - (bandWidth/2) var arcShape = new THREE.Shape(); arcShape.moveTo( outerRadius, 0 ); arcShape.absarc( 0, 0, outerRadius, 0, radians, false ); arcShape.lineTo( Math.cos(radians)*innerRadius, Math.sin(radians)*innerRadius ); arcShape.absarc( 0, 0, innerRadius, radians, 0, true ); var geometry = new THREE.ShapeBufferGeometry( arcShape ); return geometry } Is there a similar abstraction or... what are the Babylon building blocks to build a 2D fat arc?
  6. Butterwell

    Sprites don't consider parent's position?

    Never mind. I went with flat meshes. They will be superior when rearranging the board, anyway.
  7. Butterwell

    Sprites don't consider parent's position?

    Well, I'd like to use sprites as part of a dynamic board. Having them all move together once placed would be a lovely thing.
  8. Butterwell

    Unable to get Second Camera to Render to Material

    Wow. You rock. Thank you.
  9. Butterwell

    Unable to get Second Camera to Render to Material

    That did help. Which is why I'm as far as I am. There is only one camera in that example, tough. I can get the first camera, pointed anywhere in the material. I can't seem to get a second to do, well, anything.
  10. I'm trying to get a rear view rendered onto a mesh. Here's one version that doesn't work, it uses the forward camera. I'd like to see the rear boxes in the upper left corner rather then the spheres. http://www.babylonjs-playground.com/#1DXLJL Any help is appreciated.
  11. Butterwell

    BabylonJS, the game loop and "time"

    I found that using scene.getLastFrameDuration(); caused movement slowdowns (when multiplying rotation and translations by it) near large objects. I use this instead and everything is smooth: // Put this at the end of all the JavaScript, since it starts immediately.var clock = { before: performance.now(), getDelta: function () { var now = performance.now() var delta = now - this.before this.before = now return delta }}
  12. Butterwell

    Behavior of objects different in playground

    And move everything into createScene, and... Tada! It works. http://www.babylonjs-playground.com/#RZ2XP#7 Compare #6 and #7 The essential difference is that everything is in createScene. Gotta love scoping.
  13. Butterwell

    Behavior of objects different in playground

    Here's a version with no human interaction needed. http://www.babylonjs-playground.com/#RZ2XP#6
  14. Butterwell

    Behavior of objects different in playground

    Notice, also, that the rendering position of the spheres (all uniform size) seems to be different from the camera clipping (terminology?) position of the spheres: they get no bigger yet disappear from view after a while.
  15. Butterwell

    Behavior of objects different in playground

    Thank you, glad to be here. Sure. The cube is static at 0, 0, 0 global. The spheres "should be" static, I think. When served from my local machine (and when running from file://) the spheres are static. The camera is moving in conjunction with it's parent, "target". The sphere appears static because it's moving at the same clip as the target on the playground. You'll if you turn a bit to the left or right (arrow keys) and continue to generate spheres © you'll notice that each new sphere is generated a bit further away. (Again, on my local machine, they get generated right in front of the camera) My code might not be best practice for adding an object right in front a moving target/camera, and any pointers about how to do that another way are appreciated. (I thought it might be a version difference, but both the playground and locally I'm running v2.3.0-alpha)