Search the Community

Showing results for 'snap' in content posted in Questions & Answers, Announcements, Bugs, Demos and Projects and Content creation (3dsMax, Maya, Blender, glTF).


Didn't find what you were looking for? Try searching for:


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

  1. Hello, I was using gizmo and set snap distance to Pi/4. What I realized was that on positive direction, gizmo snaps to Pi/4, on negative direction it snaps to Pi/8. I'm not sure if it is really a bug but I was able to replicate it in pg: https://www.babylonjs-playground.com/#31M2AP#45 . If this is not a bug or if there is some workarounds you can suggest I would appreciate, If this is a bug I'm glad I reported it.
  2. Hi guys So I've been wrestling with a problem for a little while and hoping to cast it out there for your thoughts. As part of an app I am developing i wanted to introduce snap-to functionality such that when a mesh was dragged within certain distance of another, the dragged mesh would snap into same orientation as the other - basically 2 "allowed" faces would point at each other and the mesh would be positioned so these faces were adjacent. As a pre-cursor to this I created the playground scene below to prove the concept. Basically this creates 2 static boxes, the second rotated randomnly in relation to the first. When you click the mouse anywhere in the scene it should rotate the first box to match the orientation of the second and translate it into same position for easy validation that the alignment it has worked. The approach is a function that takes 4 parameters (ignore the fifth for now); mesh1, mesh 1 face number, mesh2, mesh 2 face number. The function calculates the normal of those faces, the angle between the normals and the rotation axis and rotates mesh1 so that the faces align and then moves the mesh1 to mesh2.position. So far so good and this seems to be working ok. Click the scene and the box faces align and box 1 moves to same position as box 2. Obviously although the faces are now pointing in the same direction they are likely to be skewed around their now common normal/axis. So the intention was to call the function a second time this time specifying 2 new faces, perpendicular to the original 2 faces that are now pointing in same direction. This should calculate the angle between those 2 new faces and the axis around which to rotate (which should be the normal to the original 2 faces). This is where it goes wrong - when line 177 is uncommented to call the function a second time it causes the boxes to go out of alignment and repeated clicking causes it to randomnly point in different directions. In theory it should correct itself on each click but it does not. Any thoughts on whether the logic is sound and on the execution? I am re-rendering the scene after the first alignment call, but I do wonder whether it is not fully re-computed the vertex data and therefore the normals used to calculate the new angle of rotation/axis of rotation are wrong. Thoughts? http://www.babylonjs-playground.com/#1JX3ZX#83
  3. When swapping out meshes with large animations After a few swaps I get an OOM error. By swapping out animations I mean dispose of the previous mesh and load a new one. This was also an issue in THREE.js, but seems to be less of an issue because Babylon seems to handle files with large amounts of animations much better. However, it appears that both leave these animations in memory even after disposing of the mesh. What is the best way to dispose of a mesh with say, 20k frames of animation, and load another without getting an OOM. Thanks in advance for the help.
  4. Hi guys. I have a new little problem, as usually I have a basic tree animation. It works wonderfull in 3DS Max. I set bones influence to 4. In exporter pop-up I check "Try to optimize vertices" button, I unchek Auto animate and, I set from 0 to 101 But in scene it move with a "snap" arround frame 50, and I don't know why. I have a problem with animation, or I have to set something special in 3DS Max? Or it's a problem with the exporter? I use last exporter - Max2Babylon-0.24. And I have a lot of animations in the scene and all works fine. I export another animation with the same exporter, and it works fine too. Code used: BABYLON.SceneLoader.ImportMesh("", "", "copac_2_animat2_motion2.babylon", scene, function(m, p, s) { m[0].skeleton = s[0];scene.beginAnimation(m[0].skeleton, 0, 101, true, 1.0); });Please help me. Thanks a lot and happy halloween animation.zip
  5. Is there a way to make the arcRotateCamera snap to certain points? I want it to snap to areas of interest when its being spun around only on the Y-axis.
  6. What type of crane(s) do you want to make in your game? What do they have to do? What is the aim of your game? etc. (Need a bit more info then just 'a crane game'.) Then I can look up some of my code and see what's useful. In my game there are different types of cranes that operate differently. Thanks. I'll use Mesh.setParent(obj). Didn't know about that. Until now I used mesh.parent = null... good to know there a proper function for it 🙂 Hehe. The more angry calls the better 😉 No blood in my game indeed but that doesn't mean there will be no action. In contrary! The nice thing about virtual toys is that broken ones will be repaired again in a snap. I've recently learned the computer AI opponent to use the weaponry (cannons etc.) that you helped me with earlier, Wingnut. Q
  7. Hi DB. Yeah, I was thinking something similar. Perhaps hold-down the click, and then roll mousewheel... for depth-adjusting (mostly for positioning new mesh or "space markers"). I think many new users of BJS... want to "assemble". Although the BJS Editor is nice, sometimes it seems... that mesh could use a "snap-on GUI"... perhaps .guiManager. Add one, activate it, and very nice menu with arrow-buttons and readouts... happens somewhere on-screen. You never really drag a mesh to new positions or rotations, but you use the GUI panel buttons to move/rotate the mesh. In this way, the mesh sort-of carries-around its own editor. We're still positioning via pointer/clicks, just... not dragging. Instead, MeshMenu v1.0. *shrug* Later, with add "snap" Likely, somebody has already built it. I think I once made a right-click-on-mesh pop-open menu (context menu)... but I did it using Canvas2d. Newer GUI system can handle it fine, too. RIght-click to pop-open a mesh's "personal editor"? Sounds ok, eh? Really, the GUI/funcs in my goofy space-flyer playground... is a pretty good start. It has 6 buttons for rotate, 6 buttons for position, but needs 6 more buttons for scaling. Use symbols on the buttons, instead of text... and you should be able to shrink the 18+ button menu... to 15% x 15% screen space (3 inches by 3 inches). Have that pop-open under a mesh... when the mesh is right-clicked. Nice. Maybe allow the readouts to also be inputs... let users type-in numbers. Same things that dbawel speaks-of... only 1500% overkill added, and never used by anyone.
  8. Hello everyone, Trying to change scene environment textures smoothly with some kind of 'fade-in-out' effect rather than a hard toggle. Please consider this PG: https://playground.babylonjs.com/#26LZLL When the buttons are clicked, the environment texture is toggled between two .env maps. Is it possible to make the toggle more smooth, so it is more like a 'transition' than a 'snap'? Even a simple overlay of the two maps is ok. Hope someone can point me to the right direction. Thanks a lot! PS: Those handy test spheres in the PG are kindly provided by @PatrickRyan
  9. nevermind. I figured out how to run it with npm. Still wouldn't mind a native snap for this in ubuntu. But I'm not sure if its worth it.
  10. Yes the appearance is much better like that. For the code to use, can be a question of current usage habit. [edit] Snap mode does not seem to work with the 3 axes (why could not this work also with the 3 axes?) : https://www.babylonjs-playground.com/#31M2AP#21 I find it regrettable that the rotation is with rotationQuaternion not not the possibilities to define euler. it was for me a preference to use euler, because I block quaternions on my meshes with mesh.rotationQuaternions = null; because I have to do it like that on my characters to control them more easily. And I recover in an editor the data euler and not quaternion. We can add layerMask to the gizmo ? because I have scene that uses it and suddenly it could be useful. In the case of using multi window to make a minimap, I would not want the gizmos to be displayed in the minimap, so LayerMask is useful for that. It would also be interesting if you could add to gizmos the ability to move multiple axes at the same time for position and scale. For example by adding a small cube in the center of the gizmo as can be seen on the images of examples. This can be very useful for resize the 3 axes at the same time or move 3 positions by selecting this center Thank you
  11. Wonderful, @Arte! Some suggestions (these are only what I would add, I don't have any time right now): When you hover over source mesh, it should show all available snapping points. Once you choose source snap point it highlights it or removes all others, and then destination mesh shows all available snapping points. Double click on destination requires you to input an offset. Eye candy - the source mesh could animate quickly to destination point: var ease = new BABYLON.CircleEase(); ease.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT); BABYLON.Animation.CreateAndStartAnimation('MeshAnim', mesh, 'position', 30, 30, currentPos, newPos, 1.0, ease); Really well done.
  12. Now, if only I could get Blender to export Vertex Groups, then we could snap to any pre-set point, not just vertices of the mesh or bounding box points.
  13. HI-5 Sorry guys we are out of tune. Back to snap - back to reality.
  14. Snap offset would be preset for simplicity. Button in my project is just On-Off snap.
  15. *nod* Sometimes, the primary objective... is to drive it all with the keyboard and not need the mouse. This allows things like voxel constructions... to be built very fast. All your offsets are probably... 25%/50%/75%... and you can almost "type" a construction just like you would a sentence. Not sure if that is sought... but if it IS, that opens-up many hot keys and easy-buttons. Even things like... keep hitting control - [ & ] ...until the snap is positioned as wanted. (Keypresses cycle-thru all the possible snap-to scenarios until user finds one that user likes). Any thoughts about activating entire keyboard?
  16. Not sure if either of you use Blender, but their edit mode snapping (active) is great as it enables you to choose the point that snaps onto another (a bit like my mostly functioning PG). @Arte, as regards the snap offset... would this be from user input or preset? I vaguely recall seeing a demo of your cabinet designer and there was a snap button, next to it you could have offset; x, y & z.
  17. Hi guys! Selected mesh needs an elevator system, both upward and downward, eh? U/D keys. The amount of Y-axis ground/selectedMesh change... could be based upon the height of the nearest non-dragged mesh (the snap-to destination mesh) (actually, its extendsTo or similar). I've only had a half-cup of coffee so far, so I could be blurry, still. More blurry than normal.
  18. When you move very fast (green box). It will snap inside box . I know we can check that is well. Another improvement: snap offset, and in general.
  19. It seems to work for me... at least somewhat. Firefox ESR. Earlier, I thought it needed alt-dragging, but I think I was wrong about that. Standard-click any mesh to turn it yellow. It must be yellow before you click again and start dragging. When the dragged item is in a position where it can be dropped, a green proxy box will activate at the snap-to position. Then release the dragging, and the selected box will move to green proxy box position... and stay yellow/selected (green proxy box will disappear). Also, I think it can only be snapped-to a position where it is not overlapping another box. Any errors at the console, guys?
  20. *nod* https://www.babylonjs-playground.com/#HHFBT#2 There's a grid-drag-snap. (yawn) Also... umm... http://www.html5gamedevs.com/topic/20751-aabb-snapping-in-3d/ *shrug* Party on!
  21. Hey @Wingnut, I think that as I'm mainly going to be dealing with boxes, that when one box gets close to another it just snaps to it... The reason being this has to be dead accurate. I can use extremities of boundingbox and determine which to snap to (any one of the min/max, x/z can snap to any of the min/max, x/z of the other mesh), though this solution would be fairly specific to me and not necessarily to others.
  22. Your url link above isn't to 3.3 though, it's to 3.2. Your link works for me but when I try 3.3.0 alpha 8 (latest) it crashes: https://www.babylonjs-playground.com/index.html#B33X4L with a chrome, "Aw, snap!" Places I've tried this are my windows 10 desktop using chrome and my android phone using chrome. Same results on both.
  23. It is múltiple files with multiple models. Gltf files with textures outside. My computer has 16gb of RAM. The card can take anything. The problem is Chrome. It says "Aw snap!" when trying to load too much data. It seems like there is some sort of protection that if a tab is consuming too much RAM it is automatically crashed... Any tips on this? Should I try a different Browser? Would something as Electron work better? (I doubt it as it has chrome inside) Or are there any caching settings or offline mode I should use so that models are loaded just once? I think the issue is the huge files being loaded as blob to browser which I imagine is how Babylon opens them? Thanks!
  24. Hi Foumfo. I want to remind you... that just because Wingnut has an idea, doesn't mean it's good or right. It's simply one way to do it. After some tests, you might find better ways. More comments may come, too. I'm certainly no expert in game programming. Here's another demo... with 'spin' and 'move' functions installed/used. https://www.babylonjs-playground.com/#1MK1Y4#7 Issues: - After Q/E 45-degree turns, cambox still wants to WASD-move in WORLDSPACE directions, but cambox SHOULD move in cambox's LOCALSPACE directions. (if box is turned 45 degrees, all cam/cambox WASD moves should be rotated 45 degrees, too.) - Held-down keys do not repeat. Probably should. - Hemispheric light's .groundColor (line 36) might not be working. Sides of cones SHOULD be lit/colored, and not black, I think. ------------------------------ Lines 109-111 parent the camera to the box and remove any old positions or far targets. Even though I did not set cambox.visibility = 0, you can't see it... even if you tilt the camera downward with the mouse. By setting camera.minZ to something like .01... you might be able to see it again. I did NOT clear the .input of this camera. I wanted to keep being able to look around... with mouse or cursors, for now. Also, animations are not required. We could "snap" the camera to new positions and rotations... instantly. I think the keys would repeat when held, that way, automatically. There might be ways to tell the animations to do LOCAL SPACE animating instead of WORLD SPACE, but I'm not sure how to do that. Maybe others will help with that. Anyway, now you have an example... of what a camera... parented to a box... looks-like/acts-like. Not too bad, eh? Something to play-with. Talk soon.
  25. Hi again! Okay, on the high-interest subject of hacking an ipod controller for BJS GUI (snore)... https://www.babylonjs-playground.com/#91I2RE#29 Mostly, work happening in updateValueFromPointer() below line 280... the center-drag circle functionality. (_draw is also involved, of course. onPointerMove, too.) Drag-circle now stays within outer ring, and this.value now maintains "clean" offset-from-center numbers. (see console while dragging center-circle) I also activated a snap-to-center on pointerUp. ALso, this is a FREEcam version. Previous was ARC. Next, I'll start working-with the outer ring (the 4 quarter-round buttons). See the 'ang' formula in line 275? 'atan2' ! Wow, that sure sounds mathy. Scared? I am. Remember the TV show "Ark 2". Wow! For those not paying attention, the quarter-round buttons are not really buttons. Because of their shape, its a pain-in-the-butt(on) to determine their 'click zones'. Soooo, I... (and the huge group of volunteer helpers that have climbed-aboard this campfire adventure)... will attempt to determine an angle... from center of circle... to where-clicked-on-outer-ring. FROM that angle value, we will determine which button was clicked. And again, no onEnter, no onExit, no onButtonDown/Up, none of those will be active. Each of the quarter-round buttons are stupid-buttons, to a degree. MAYBE... we can do a changeButtonColorOnMouseOver... later. MAYBE. For now, let's get their clicks workin'. Sorry this is going so slow, Vikk. This project is right at the top edge of my intelligence level. Help welcomed, as always. I could use help about... how to label the buttons. Keep in mind that I would like to allow the outer ring... to have ANY NUMBER OF BUTTONS. Most ipod controllers just have simple arrowheads for labels. But later, when we use this controller in full-screen mode (space-fighter HUD circle), each of the buttons (perhaps up to 30 of them)... will need text labels, too. The ONLY way I can think to do this... is to make the user create all the labels, already in a circular pattern... on a single image/texture (in a 2d paintbox app). Then I can POSSIBLY overlay that single texture... atop the ipod controller. It will label all the buttons... with one overlay-image. Help welcome... on overlaying a single transparent-background "labeling image" atop entire ipod controller. If another canvas is needed, it must be rendered "in-front" of course, and cannot be click-blocking for the outer-ring canvas, OR for the invisible square canvas in the center. It is my hypothesis so far... that both of those canvas are needed... to determine _isPointOnSquare or _isPointOnWheel. I haven't studied those functions yet, though. This single "labeling image" MIGHT ALSO be able to "texture" and border the controller... making it look similar to a standard remote control. *shrug* Party on.