splash27 Posted December 10, 2017 Share Posted December 10, 2017 I've created a stairs from BABYLON.MeshBuilder.ExtrudeShape, but is doesn't work. I start to drown into mesh after reaching the top of the first step. However, stairs from regular boxes works well. You can check them both at my playground: https://www.babylonjs-playground.com/#PVAC9F Also, I have to say, that stairs from ExtrudeShape doesn't look good. Look at theese side caps. Also I have trouble with positioning. Changing the third parameter of createStairs function doesn't affect where stairs appears. I have to change position by position property of mesh after creation (I do this inside function at this moment). Quote Link to comment Share on other sites More sharing options...
JohnK Posted December 10, 2017 Share Posted December 10, 2017 Hi and welcome to the forum. Here are some stairs using ExtrudePolygon https://www.babylonjs-playground.com/#RNCYVM#34 documentation JackFalcon, jerome and Arte 3 Quote Link to comment Share on other sites More sharing options...
splash27 Posted December 11, 2017 Author Share Posted December 11, 2017 Stairs from ExtrudePolygon looks much better. However I still start to drown after reaching the top of the first step. How to fix? https://www.babylonjs-playground.com/#PVAC9F#1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 11, 2017 Share Posted December 11, 2017 Hi guys. @JohnK, ya "bought the farm" on this one, eh? https://www.babylonjs-playground.com/#PVAC9F#2 Just another. I lined up the camera, put it in the air and set _needMoveForGravity = true; Then added my flaky .showEllipsoid func, and went to work in 138-140, putting the collider in the center of the first step as best i could. That's not going to work, though. Not only do we need a collider on every step, but as long as camera.applyGravity is ON, the camera will not climb-over the collider. It keeps sliding-off the collider backwards, because the camera gravity won't let it climb over. WE got trouble. BIG BIG trouble. Ok, not that much trouble, but some. I don't think extruded stairs will ever be collider-climbable... not without some serious hackus big mackus. Thinkin'. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 11, 2017 Share Posted December 11, 2017 Oh, Naz is on-forum ( @NasimiAsl )... he built a big shopping center with long, climbable stairs. http://melyon.ir/ (slow loader, but gorgeous). Enter tallest building. Many stairs inside. I don't think camera gravity is active AT ALL in Melyon. Perhaps terrain-following, though, and that might be the same system that climbs the stairs. Thoughts, Naz? Maybe he used invisible mesh parented to camera(low height), and when mesh intersects next step, he lifts camera/player one step-height (probably with NO camera gravity active... when player/camera is upon stairs). I guess that IS basic "feel-with-a-stick" terrain-sensing, eh? Need picking-ray or bounding box intersects... something like that. More thinkin'. Quote Link to comment Share on other sites More sharing options...
splash27 Posted December 12, 2017 Author Share Posted December 12, 2017 Well, I decided to choose an easy way and just to create stairs from merged boxes. https://www.babylonjs-playground.com/#PVAC9F#3 It fits what I need. Hope, it also will be useful for other developers. Just one notice. It starts to work glitchy with low width of the step (parameter w). So I don't recommend to use values lower than 0.5. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 12, 2017 Share Posted December 12, 2017 Oh Splash, that is MARVELOUS! I LOVE how the far horizon bounces with each step taken. And I like how reversing direction on the stairs... works perfectly. Good good good. Yes, this will be useful for others.... definitely. Nicely done! Thanks for sharing! I can't believe how well the collisions work on that thing. Just... sweet. 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.