• Content Count

  • Joined

  • Last visited

Everything posted by vtange

  1. Hi everyone! https://vtange.github.io/boxgun/ This is Boxgun, my first game with BabylonJs! It’s a projectile game. You have 10 seconds to drag and shake the crystal you see on-screen to charge the box cannon, with which you try to fire a box as far as you can! The game stops when it detects your box is done moving. Controls: (in menu) Z or Enter: ‘OK’ in menu up, down: move up and down the current menu. (in game) Spacebar: fire P: pause, unpause …or you can just use your fingers or a mouse Note: Babylonjs only powers the 3d picture parts. The UI is actually an HTML5 DOM overlay. Enjoy!
  2. Where'd you get 170kb? I get 924kb with https://code.playcanvas.com/playcanvas-stable.min.js
  3. Yup. Making a new mesh of position (0,0,0), parenting it to the Rocket, and pointing the camera to it works. After that it's just a matter of assigning the shaking animation (move position.x or whatever by 0.1) to the new mesh.
  4. I read this multiple times slowly and realized this is probably what I'm looking for. I'll try it out later when I have time. Thanks for the epiphany!
  5. Just to add, I have gone through which sounds like someone else has managed to do something similar to what I'm thinking. If possible I'd like to know how it was done.
  6. Hello everyone! How can I get a camera shake animation to work with ArcFollowCamera? I'd imagine this is useful for situations like a ball (that you're following) hitting a ground or a rocket lift-off sequence. Here's a playground for a cylinder (rocket) doing a liftoff in 1000ms. I can get a "shaking" animation working for the rocket. https://www.babylonjs-playground.com/#5HHLEC But when I try to do the same with the camera nothing happens https://www.babylonjs-playground.com/#5HHLEC#1 I'm guessing it's because ArcFollowCamera is overriding the camera's position with every frame. Is there a way to do this without resorting to the former? The problem with animating the rocket is it feels off seeing the rocket remain static on the screen while everything else shakes.
  7. Got it. I hadn't thought of this, but yeah I have a "great hall" that's currently one big mesh. Fortunately the flooring is tiled so it is possible to do what you mentioned. In Blender do the materials have to literally be different, but using the same texture, or does BJS only care about lighting on a mesh-to-mesh basis? If this is the case then all my columns should be fine as is; since they are separate instances in the "great hall", and have enough distance that other lights don't affect them. Haha I didn't know that BJS even had a mesh-highlighting feature until you told me about it, naturally I'd think you know quite a bit on it.
  8. How exactly does the highlight system work and how does it affect performance? I was just tinkering around and realized hey, maybe I could do a map-wide mesh that's invisible but emits a "shadow" highlight with a dark grey color or something, and have the rest of the map be bright-as-heck. Wouldn't that work? EDIT1: First failed try with new "shadow" object. I tried to be clever and make the "shadow" mesh have inverted normals on purpose to make it invisible. Maybe inverted normals mean highlights don't get triggered? https://playground.babylonjs.com/#F2H81M#4
  9. Hi Wingnut. The Highlight layer trick is pretty neat! It certainly makes the sconce look more like how I originally envisioned it. It now just needs to light up that side of the wall/the ground below. So emissiveTextures aren't as strong as I thought...I was hoping I didn't have to rely on adding lots of lights in a scene. (The playground we have here is a small piece of a larger room with multiple columns and sconces.) My worry is relying on a pointLight for every lamp might impact performance...plus I read somewhere that materials in BJS only react to 4 light sources?? Wouldn't that mean that given a room I can only have four columns with lights? EDIT: I was writing this post as I read your reply, so I might really have to do this "light baking" trick... Do you know of any good examples of this in .gltf? I somehow doubt it's just throwing in an emissive layer on every texture. Plus it'd get annoying to have to do the column AND the floor separately. Funnily enough I don't even know why Blender showed the illumination. There was literally no light in the sconce mesh. The .blend file is literally 3 objects: the floor, column, and light. You can check the hierarchy on the upper right
  10. Hello everyone! I'm trying to learn how emissive textures work in BJS, and through this tutorial (https://github.com/KhronosGroup/glTF-Blender-Exporter/blob/master/docs/user.md) managed to get a Blender model with an emissive texture (basically itself) loaded in BJS as a .gltf model. However, even though in Blender's Cycles Render I can see some illumination from the light on the wall, I don't get any lighting in BJS. Why is that? Also, is there a setting, in Blender and in BJS, that controls the range/brightness of the light? I'd light it bright enough to light the floor Here's the bare-bones playground: https://playground.babylonjs.com/#F2H81M
  11. Oh my god @RaananW you are a GOD. I'm glad my mesh helped you find the problem and fix it. Yeah I'm aware of the invisible walls - I kept them there on purpose to see if the balls would go through them in one direction or something. With this fix, we can theoretically make a pinball game with a Sketchup Model and 1 ball
  12. What did deltakosh tell you? So is there anything I should fix in my playground or regarding the mesh? Thanks so much for working on this. I'm a newb in BJS so from my POV you and deltakosh are both awesome. If there's anything I can do to help, do tell
  13. Hmm, that's weird. So the scaling is still off even when the model is not in negative space? In the playground it clearly is in (55, Y, 55) instead of -55 now. How are you checking the scaling, rotation, centering, of the mesh? Is there a specific part of the .gltf file you're reading? * I got work right now and won't be able to work on the mesh soon, but I'd like to know so I can get something done quick once I'm home
  14. I would take my time and look at 2D game engines first if you're thinking anything along the lines of focusing on sprites that move in a X-Y plane. IMHO using Babylon.js for a 2.5D game like what's discussed here http://www.html5gamedevs.com/topic/22268-25d-beat-em-up-jump/ would be overkill since you're not taking advantage of a lot of what BJS has to offer. If you're thinking something like Super Mario 3D world but you only move in 2 directions Left Right Jump/etc. then yeah it's pretty much oimo, cannon or the default.
  15. Hey Raanan, Thank you for testing around and explaining the .ImportMesh stuff to me. Yeah I didn't know about the ignoreParent flag and the details about how the meshes are structured after import. Is there a reason why the Blender exporter just exports things the way it did with a parent-child relationship. I had a feeling thru skimming the .gltf and debugging that there was a mesh in my imported mesh, but couldn't tell which was the 'official' one, so I assumed it was the one at the highest level. Anyways, apparently when you draw with Sketchup, everything is in negative space, so we ended up with the negative scales and funky stuff. Here's a new playground with everything in positive space. Same box room, just rotated 180 degrees in Sketchup and exported. https://www.babylonjs-playground.com/#SVHR8A#2
  16. https://www.babylonjs-playground.com/#SVHR8A I'm trying to create a simple (at least in my mind) scene where I have a ball rolling within the confines of a single mesh "room" I built in blender and exported as .gltf. However, no matter what I do, the ball seems to always go through the imported mesh and hit the ground below (which I kept to make sure the ball doesn't fall forever). Am I doing something wrong? In the playground there isn't a physics engine but locally I've tried cannon.js after reading that it supports MeshImpostors but I get the same result with or without a physics engine.