Search the Community

Showing results for tags 'extrusion'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 6 results

  1. Hello, I am new to babylonjs and am trying to extrude a non regular polygon towards the positive y direction. Going through the doc I couldn't find a way, it always extrudes it in the negative y direction. I found a hack using mesh.position.y += depth; but is there any other way of doing this ? Playground link : http://www.babylonjs-playground.com/#2EYZPE#7 Thanks.
  2. Trying to help this topic The problem is scaling texture on the caps of an extrusion. What is needed is something like this on the caps what I get is http://www.babylonjs-playground.com/#TF811Y#5 any suggestions
  3. Hi people, I just added a new optional parameter, called invertUV (boolean, default false) to every ribbon based shapes : ribbon, tube, lathe, standard and custom extrusion. var rib = BABYLON.MeshBuilder.CreateRibbon("r", {pathArray: paths, invertUV: true}, scene); This swaps the U and V coordinates at geometry construction time. What is this for ? Imagine you've got two different meshes, say, a tube and a sphere and they share, for performance reasons, the same material/texture. You notice then that the texture is applied on to the tube the wrong way (horizontally, for instance) compared to what you expected, but the right way on the sphere. If you build your texture by rotating the image for 90°, you will have then a right textured tube but a wrong textured sphere. So instead of making two different images and to use then two different textures/materials to solve your problem, you can now just invert the UV on the tube and its texture will switched horizontally/vertically. [EDIT] : 2 tubes, one material/texture, 2 different orientations http://www.babylonjs-playground.com/#G6DG0#8
  4. The problem: In the awesome Three.js, I can't figure out how to convert an EllipseCurve into a path that I can extrude along. In the example below, if I uncomment the LineCurve3, my square extrudes along it nicely. If I run it as the EllipseCurve, there are no errors but nothing shows on screen. I have tried zooming the camera right out to make sure it's not off the screen for any reason. I know the EllipseCurve is being generated correctly as I can write it out with a line material (not shown in the code below). The code var radius = 1100; var degreesStart = 75; var degreesEnd = 30; var radiansStart = (degreesStart * Math.PI) / 180; var radiansEnd = ((degreesEnd) * Math.PI) / 180; // this won't seem to work as an extrude path, but doesn't give any errors var path = new THREE.EllipseCurve(0, 0, radius, radius, radiansStart, radiansEnd, true); // this works fine as an extrude path //var path = new THREE.LineCurve3(new THREE.Vector3(0, 0, 0), new THREE.Vector3(1000, 1000, 0)); var extrusionSettings = { steps: 100, bevelEnabled: false, extrudePath: path }; // draw a square to extrude along the path var sectionSize = []; sectionSize.push(new THREE.Vector2(0, 0)); sectionSize.push(new THREE.Vector2(1000, 0)); sectionSize.push(new THREE.Vector2(1000, 1000)); sectionSize.push(new THREE.Vector2(0, 1000)); var sectionShape = new THREE.Shape(sectionSize); var componentGeometry = new THREE.ExtrudeGeometry(sectionShape, extrusionSettings); var component = new THREE.Mesh(componentGeometry, material); group.add(component); scene.add(group); What I have tried: My attempts to make it work have all tried to extract the points from the curve into a path to use in the extrusion. The closest I felt I got was var ellipsePath = new THREE.CurvePath(path.getSpacedPoints(20)); // where 'path' is my EllipseCurve in the code above // (and then changed the extrusion settings to use 'ellipsePath ' instead). This gave the error "Cannot read property 'distanceTo' of null". I can't seem to get my head around how the EllipseCurve relates to points that relate to a path. Can anyone point me in the right direction please, or have code where you've come across the same problem? Many thanks.
  5. http://imgur.com/PDBj6MG Basically I'm trying to extrude a shape on the Y axis. All of the points have a Y of 0, only the X and Z are differing each time. When you're looking at the picture, you can see the white lines are the points connected by BABYLON.MeshBuilder.CreateLines, so the points shouldn't be the problem. However, if you are looking at that big grey thing going in the air, that's the extruded shape from the points. It seems that it doesn't extrude properly on the Y axis so it's really messed up. The code looks like this: BABYLON.MeshBuilder.CreateLines("line", { points: meshPoints }, scene);var block = BABYLON.MeshBuilder.ExtrudeShape("block", {shape: meshPoints,path: [new BABYLON.Vector3(0, -1, 0), new BABYLON.Vector3(0, 0, 0)],scale: 1,cap: BABYLON.Mesh.CAP_ALL}, scene);As you can see, I just want it to be extruded from the bottom to the top, which should result in a box which follows the mesh points. It should look like the white lines, but then filled up and having a "height" to it.
  6. As part of my cubees project (see Babylon Projects thread) I am developing a gui tool for producing extrusions and hoped somebody somewhere might like to see an example I produced with it. The seat, leg and back were all produced with this extrusion tool. (You will find a limited description of how this was done from menu --> help They elements were then all put together in this playground http://www.babylonjs-playground.com/#1XBSL1#2. It still a bit rough and ready, more work needs to be done on using measurements particularly in the cross section. As an alternative the lathe tool could have been used to produce legs like these Anyone interested can find all the code at https://github.com/Cubees/Cubees.github.io Note for Jerome - sorry I tried to use to build the extrusion mesh from your ExtrudeShapeCustom. While I worked out :- how to get the correct data from the rotate parameter for the rotationFunction, how to separate the x and y scale so that they were independent by changing scaleInPlace usingBABYLON.Vector3.prototype.scaleInPlace = function (scale) { if(typeof scale === 'number') { this.x *= scale; this.y *= scale; this.z *= scale; } else { this.x *= scale.x; this.y *= scale.y; this.z *= scale.z; } return this; };So then when var V=new BABYLON.Vector3(1, 1, 1); //and var scaleVec = new BABYLON.Vector3(2, 3, 4);V.scaleInPlace(5); //results in (5, 5, 5) and V.scaleInPlace(scaleVec); //results in (2, 3, 4)I could not successfully work out how to obtain the path from the tilt, twist, move x and move y parameters. In the end I went for constructing the extrusion using a ribbon.