Nutiler

Members
  • Content count

    9
  • Joined

  • Last visited

  • Days Won

    1
  1. Pick Up Mesh with Physics

    I read this and immediately thought of "can I get a hat wobble box jiggle"
  2. Pick Up Mesh with Physics

    In #13-14 I haven't been able to shove the object through the ground with the current controls. With: distanceFromCamera = 4; It seems I cannot push the object through the floor, the farther away the object is the easier it is to push it through. It kind of works as intended? In the Source engine prop killing was a problem due to this same effect when the object wants to go into the ground it'll eventually shoot out with a velocity when the environment says 'THE BLOCK SHOULDN'T BE IN HERE' and applies velocity to get it out. https://i.gyazo.com/92bc24fe6af5eb7833c2ca09d4c82ff8.mp4 This is an issue right now and when I get it sorted out I'll be sure to post another, perhaps with another dumb physics game. I think the object should react by retracting it's distance to the camera when it realizes it has nowhere to go. If you add collisions to the player you've essentially recreated prop-surfing. The other issue is the rotation not looking at the player, it's difficult to tell when the object is a sphere though! @Raggar I'm glad you've had fun with this! Playing your version on a higher refresh rate monitor makes it feel like light speed haha! I should have a toggleable FPS lock on this. @Wingnut Just messing with this one project has me getting ready to drop everything I've worked on in three.js - this community itself is so great and I'm trying to learn the more in-depth tutorials and solved questions so I can help others on this forum!
  3. Pick Up Mesh with Physics

    https://playground.babylonjs.com/#0H29AJ#13 It's tons of fun to play around with! QWER now rotate the object in hand, spacebar throws the object in front of the player. On 60/FPS it feels very slow, so feel free to crank up the velocity & speed. Line 135 applies the rotation I desire but I haven't had time to look at how to allow rotation while doing so! https://playground.babylonjs.com/#0H29AJ#14 Demo 13 wasn't enough fun... so enjoy playing a rigged game of basketball. I didn't actually hollow out the cylinder, which I should use createTube instead... but for now, enjoy the carnival game! https://playground.babylonjs.com/#0H29AJ#15 EDIT: It wasn't fair to post a broken game... I couldn't sleep so here's bowling. Walk back and then forward and release the mouse to roll it, or lob the ball with space. I'll be sure to post a final demo once I get everything I have planned for this done. Huge thanks to @Raggar and @Wingnut I really appreciate how much you have helped me!
  4. Probably the most intense music for a printer! Anyways I love the animation's this is really cool! I would suggest a simpler environment so it doesn't take too many resources to run.
  5. Pick Up Mesh with Physics

    @Raggar #12 looks fantastic! Wow. Thank you so much. Everyone has had such good ideas this is exactly what I need to progress! The only thing I'll be tweaking is making the object hold it's rotation on pickup but for now, it's a minor detail. @Wingnut Thank you for your contributions as well, I've used so many playgrounds you've posted to learn, I'm starting to love this community.
  6. I use this for loaders: https://doc.babylonjs.com/extensions/obj BABYLON.SceneLoader.ImportMesh("name", "./assets/models/name", "name.obj", scene, function(object) { // You can apply properties to object. object.scaling = new BABYLON.Vector3(0.9, 0.9, 0.9); }); If you want to apply properties to multiple objects if it is a complex object you can do object.forEach and apply all of the properties. You will get a WARN that name.obj.manifest is missing so if you create that file but empty it will be fine! To use localhost they have most likely set up a node.js server for their project, whereas you are using static javascript.
  7. Pick Up Mesh with Physics

    @Raggar After playing with the playground these are great features and I like what you have done! As wingnut pointed out I would really like the object to look back at the player from the same state it was picked up similar to if it was parented. My next goal after that would be to rotate and move the mesh like you have done with WSQE. I need to spend some time on this when I get home and just try a few of these ideas! I think right now the goal for me is to prevent the objects from intersecting other objects or phasing through the ground, whilst also keeping its original position from being picked up state face the camera. I appreciate the overwhelming amount of support I've received so far! EDIT: https://playground.babylonjs.com/#0H29AJ#9 I haven't had as much time to play with this but I really liked Raggar's playground and was testing out lookAt and billboardMode to keep the object looking at the camera which works but isn't as fluid as parenting the object but is probably for the better. I think the biggest obstacle right now would be to somehow apply the same physics collisions as when the object isn't held. Right now when the block intersects another object it phases through it and moving it out gains this terrible velocity. I would ultimately want the mesh to not go into the object and instead make it kind of like it hits a wall where the player can get closer but the object will stop going into the ground or mesh like this: https://i.gyazo.com/92bc24fe6af5eb7833c2ca09d4c82ff8.mp4
  8. Pick Up Mesh with Physics

    Thank you all! I've seen some of your works and they have been helping me learn this library so I'm glad this community is so helpful! @RaananW Yeah, I see what you mean by not having to recreate and remove it every time the object is touched. The reason I used the camera as a parent was I wanted to keep the object in front of the players face at all times similar to this: https://i.gyazo.com/92bc24fe6af5eb7833c2ca09d4c82ff8.mp4 I'm having a hard time understanding how to build the mechanism but I see what you mean by keeping physics intact so I cannot just phase through the ground when looking at it. Do you know of any playgrounds that use this type of interaction? @Mythros Of course! Once I get this functional I'll be sure to post the barebones for this project before making what I want out of this! @Wingnut Heya, I tried your playground and it seems to step in the right direction! Similar to what Raanan said where I don't remove the impostor and use a parent. The movement of the block is a little strange but seems to work and interact better with the environment. I think I'll need to add better controls to keep the box in front of the player when rotating the camera. Another playground I've seen between object collision I think will help me is this one: http://www.babylonjs-playground.com/#OMBOJ since the object will go through but upon release will update and be like "help I'm trapped inside another object" and shoot out https://playground.babylonjs.com/#0H29AJ#5 The arm idea sounds great as well, that's almost exactly how I need to do this. I would like to have the ability to rotate the object so if the object is hanging from the arm that would make that job easier as well. I do like the idea of the object being "alive" when you activate it, as of right now I'm messing with a couple ideas but I need to still look through playgrounds and tutorials to learn as I've only used this library for a day or so!
  9. Hello! I am new to these forums and I just have to say Babylon.js is now one of my favorite libraries for webGL. I have finally switched over from three.js and have to say this has been so much fun to play with. Just recently I am trying to make a physics-based environment where you can pick up and drop objects similar to the old source engine and garry's mod. I created this playground to show an example of what I am trying to create but some of the bugs are shown in the gyazo link. https://playground.babylonjs.com/#0H29AJ https://i.gyazo.com/bc01aaaced057c158f1c925cfafc06a2.mp4 The object, when held and looking downfalls through the floor. Sometimes when dropped it becomes at a sliding state where it will not stop sliding and on pickup, it will fall through the floor. So my question is, how can I stop the object from going through the floor?