Search the Community
Showing results for tags 'curve3'.
Found 3 results
solved merging/updating curve3
Mark Bufton posted a topic in Questions & AnswersHi 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?
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.