mwpowellhtx Posted March 25, 2016 Share Posted March 25, 2016 Hello, As a frame of reference, in Helix Toolkit for WPF (C#, .NET), I am calculating and rendering some coordinates to model a football Goal Post, or pylons at the end zone corners if you prefer. I want to start with a single set of coordinates, and apply a transform that basically mirrors those coordinates on either end of the field, end zone, or what have you. This is extremely easy to apply using the WPF view XAML. Let's say I have the points for the post; 180 feet from either end of center field (Z axis): // assuming "world" coordinates originate at center field, measured in feet // that's 50 yards plus 10 for the end zone; post height is 6 feet. var points = [new BABYLON.Vector3(0, 0, 180), new BABYLON.Vector3(0, 6, 180)]; After that, I would CreateTube, let's say, to actually model the object. But for right now I just want to mirror about the Z axis. The modeling bits are beyond the scope of this question, unless they aren't. My transformation vector would be something like this, I think, but I could be wrong: new BABYLON.Vector3(0, 0, -1). Similar case for the uprights; 18.5 feet wide about the X axis: var points = [new BABYLON.Vector3(9.25, 10, 180), new BABYLON.Vector3(9.25, 40, 180)]; My transformation vector would be something like new BABYLON.Vector3(-1, 0, 0). Are there utilities in BABYLON that can facilitate such a transformation? Might do a similar thing for additive transformations, as contrasted with multiplicative, in this case. Thank you... Regards, Michael Powell Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 26, 2016 Share Posted March 26, 2016 Hi @mwpowellhtx - I'm not qualified to answer this, but yes, there are MANY helper functions for transforming. I think a playground search for 'transform' is one of the fastest and easiest ways to discover many of them. That should get you rolling. Smarter people than I are nearby, too. Quote Link to comment Share on other sites More sharing options...
jerome Posted March 26, 2016 Share Posted March 26, 2016 maybe something like : http://doc.babylonjs.com/classes/2.3/Vector3#multiplyinplace-othervector-rarr-vector3-classes-2-3-vector3- ? http://doc.babylonjs.com/classes/2.3/Vector3#multiply-othervector-rarr-vector3-classes-2-3-vector3- http://doc.babylonjs.com/classes/2.3/Vector3#multiplybyfloats-x-y-z-rarr-vector3-classes-2-3-vector3- for simple vector multiplications ... If you want to apply a transformation matrix (position, rotation and/or scaling) to a vector, there is : http://doc.babylonjs.com/classes/2.3/Vector3#static-transformcoordinates-vector-transformation-rarr-vector3-classes-2-3-vector3- Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.