Jump to content

Search the Community

Showing results for tags 'curve3'.

  • 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
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

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 3 results

  1. Hi guys, Rather a technical question I'm afraid and one that I do have a functional solution to, but wanted to take the opportunity to learn something new. I'm attempting to create the deck of a ship (the Titanic) from blueprints, using a curve3 object to create the outline of the decks (eventually using it to create path points for a polygon mesh/extruded shape, but simply used as line paths for the time being). This works perfectly fine, of course, as the deck plans are completely flat - using the X and Z co-ordinates (in my case) of the curve3 I can match the outline of the decks with reasonable precision. A ship, however, doesn't tend to have flat decks - Titanic being no exception. The decks are curved upwards both forward and aft. One (almost) solution being to create an additional curve depicting the deck on a side (profile) blueprint (containing the same number of points as the aforementioned deck outline). I have written functions to extract the x, y and z points of any given curve3 path, and could pass the x and z data from the deck curve, and the y data from the side profile curve, as arguments to my own custom curve. This would work in theory, if both curves were identical - then the x co-ordinates of the side profile would match perfectly the x co-ordinates of the deck plan's curve. Where the poop deck, for instance, curves around sharply at the stern, the x co-ordinates of the deck outline will get considerably closer together, whereas they won't do so on the deck profile - using my 'solution' would likely result in a very warped deck. My solution to the problem is a simple one - simply line up the two plans and visually adjust the y input of the start, end and control points of the bezier curve function (depicting the deck outline) to incorporate the curve of the deck - which is gentle enough to achieve easily. My curious nature tends to get the better of me, as you all probably know, and leads me to ponder if there is a way to programatically get the x, y or z co-ordinates at any given point of the curve3? Take a simple curve from vector3(10,0,-10) to vector3(50,0,0) - if, for example, I wanted to know the value of z at x:31.265, am I able to get that or calculate that programatically without being a mathematical genius or including a massive number of points and searching the path array for the nearest value?
  2. Hello Babylon.js Community, I am trying to create a smooth 3D spline that goes through its control points. I was reading through the Curve3 tutorial and started a playground attempt: http://www.babylonjs-playground.com/#1GXSPK#1 My guess is that I have to create the spline step-by-step somehow with the BABYLON.Curve3.continue() function!?! Maybe I also miss a very simple approach to reach my goal? Wishfull thinking: Three.js offers exactly the spline I am looking for: https://threejs.org/docs/#Reference/Extras.Curves/CatmullRomCurve3 https://threejs.org/examples/#webgl_lines_splines Would something like this be of interest for the Curve3 class in general, e.g. var oMyNoBrainerCurve3 = new BABYLON.Curve3.CreateCatmullRom( Vector3[] ); Anyone can give me a hand? Any help is appreciated.
  3. Hello, I've got the following "simple" code. This will be the most complex my model gets, probably, but currently it is not working. I receive the following error when I call BABYLON.Mesh.CreateTube, //... var tp = createArchPoints(10, 32); var tube = BABYLON.Mesh.CreateTube('my tube', tp, 2, 12, null, BABYLON.Mesh.CAP_ALL, scene); //... Which my arch points are created using the very helpful Quadratic Bezier calculation. var createArchPoints = function(dim, count) { var po = new BABYLON.Vector3(0,0,0); // origin var pc = new BABYLON.Vector3(0,0,dim); // control var pd = new BABYLON.Vector3(dim,0,dim); // destination var points = BABYLON.Curve3.CreateQuadraticBezier(po, pc, pd, count); return points; } I know the radius, will be constant; so I do not want a radius function. The points themselves, as far as I can tell, appear to be realistic, as expected. Is there something I need to do to dress the CreateQuadraticBezier result before passing them to CreateTube? My assumption is that one returned a Vector3[], which the other expects as a parameter, but I could be wrong, it's hard to tell sometimes with JavaScript being weakly typed. Any other calculations I need will be along the lines of rectangles in 3D space, even with a couple of transformations and translations, but these are more straightforward in my mind. To help with response, my level of js confidence is growing probably 4 out of 10; 3D about the same, my frame of reference are libraries like Helix Toolkit for WPF (C#) in which I've already done a similar model, just wanting to do something like that with Babylon; also loosely familiar with THREE, so probably same, 4 out of 10. That to say, I'm learning, but I can discuss halfway intelligently. Thank you... Regards, Michael Powell
×
×
  • Create New...