jerome Posted September 15, 2015 Share Posted September 15, 2015 Hi, Since it is now quite easy to extend the CreateXXX() methods with the options parameter, I would introduce the ability to rotate a mesh at construction time. DK added to the box width, length, depth. This gives the good old BJS box the capicity to become any cuboid, right ?Actually this is quite the same than to bake the scale transformation into the mesh, although the mesh can still be scaled in the world then. Imagine the same with the rotation. If we could bake a rotation at construction time, the mesh would be built rotated in its local space once for all. The world rotation transformation would sitll be possible then obviously in the world. This feature would help to separate built-in rotations (local space and could be NOT upgradable) from World rotations. So I'm looking for a pertinent english term to give to this feature. I think something with the world rotation would be confusing. Rotation should maybe be kept for World transformations only. "turn" ?var box = BABYLON.Mesh.CreateBox("box", {turnX: Math.PI, turnY: 0, turnZ : 0}, scene);NOTE : As for scale-like (witdth, height, depth) parameters which can be applied to a box, a sphere, a plane, a torus, etc, this rotation-like parameter type would be appliable to any mesh built with CreateXXX() Any suggestion please ? Quote Link to comment Share on other sites More sharing options...
Meulta Posted September 15, 2015 Share Posted September 15, 2015 Why not simply "rotation" ?RotationX, RotationY, RotationZ ? Quote Link to comment Share on other sites More sharing options...
jerome Posted September 15, 2015 Author Share Posted September 15, 2015 I'm afraid that users will be confused then with the World transformations :box.rotation.x = Math.PI;I was looking for word in the pottery domain, as if a potter would turn/rotate his piece before baking it Quote Link to comment Share on other sites More sharing options...
Temechon Posted September 15, 2015 Share Posted September 15, 2015 alpha, beta, gamma ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 15, 2015 Share Posted September 15, 2015 I don't get why you need this. I do not want to add unused code. We have rotation and rotationQuaternion for this Quote Link to comment Share on other sites More sharing options...
jerome Posted September 15, 2015 Author Share Posted September 15, 2015 I don't speak about world transformations here but about the ability to build a once for all pre-rotated mesh in its local space.Exactly like the width, length, depth set a kind of baked scale to the mesh. Example : if we know a box should be inclined for 45° on the z local axis because it is the way it must be for ever in the world. However this box is immutable, it won't ever change. Solution 1 : we apply a rotation (or quaternion) as usual, this means we compute a rotation matrix, then we ask the GPU to apply this matrix to the box vertices. Maybe not convinient when parenting, etc. Solution 2 : we rotate the box once, we bake it into vertices, so we re-build the mesh, rotated in its own local space. So why not to do this #2 at mesh creation once when computing its geometry ? Quote Link to comment Share on other sites More sharing options...
jerome Posted September 15, 2015 Author Share Posted September 15, 2015 aarffbut I'm not going to persuade anyone : it's less work for me then ! Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 15, 2015 Share Posted September 15, 2015 hmmm... you guys are fun. So, let's see, being able to set ANY dims for a box at creation time, eliminates scaling... in some ways. Scaling always suffered from unpreventable hand-me-down scaling to children. That's one thing. Hmm... We COULD allow an options object... or... a vertexData object in it's place. Then add some rotate methods onto the vertexData objects. Bakery fresh VD! errr... hmm. I guess that would equate-to createCustomMesh(name, vertexDataObj, scene); I'm outside my league, here. It seems that Jerome is so far gone... that he's come back around on the back-side. Fun! He's the Julia Child of our geometry kitchens, and he's cookin'-up some rather exotic dishes. Jerome... there comes a time... when a guy might ask himself... "How many extra lines in the options object == one line of JS to do a rotation?" I think it's a plausibility thing. You... want to add "the power", and that's cool. It's another option... another way to create. But... yeah, you know... stuff. What if... you made the BJS HLI ? High-level interpreter. Create your own script language... for geometry plotting. huh? jMeshScript! Activate it in any BJS scene, for a small overhead price. Yeah! errr... jerome 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted September 15, 2015 Author Share Posted September 15, 2015 well, I just feel like an misunderstood accursed poet ok, I forget this (incredible) feature ! Wingnut 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 15, 2015 Share Posted September 15, 2015 I still love your poetry though 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.