Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by fateriddle

  1. @ssaket https://www.babylonjs-playground.com/#UU7RQ#1 What pg do you ... want? This is the demo skybox pg, Now I want a hole (square hole prefered) on one of the sides. (Not deleting the entire facet, just need a hole on it).
  2. Can I dig a hole in one side of a box? And in really case I want a hole on one side of a skybox. Is it possible?
  3. https://playground.babylonjs.com/#22KIIK In this playground, I see use of "createGUITexture" a lot, but when plug into my code, it seems createGUITexture is not a function... why? I've tried import * as BABYLON from 'babylonjs' import * as GUI from 'babylonjs-gui' import 'babylonjs-loaders' GUI.createGUITexture( ... ) BABYLON.createGUITexture( ... ) But it seems none of the namespace has this method...
  4. my questions followed: https://www.babylonjs-playground.com/#Y7XMAR#5 1. As shown in this PG, my goal is to show dragon one by one, walking towards you, so I used setInterval, is it a good way to do it and if not, any alternatives? 2. I can't seem to hide the original dragon, if I dispose it, nothing will be cloned, but if I just set its isVisible = false, doesn't work. 3. How do I play / stop the animation of the cloned dragons? I don't know where to find the animation instance to play.
  5. https://www.babylonjs-playground.com/#Y7XMAR#3 This pg. I try to copy 3 dragons with mesh.createInstance, but it doesn't work. However if you comment out line 16 and uncomment either line 14 (skull) or line 15 (tree), both work. Is it because dragon is a .gltf file and tree/skull are .babylon file? How do I work with .gltf files?
  6. @V!nc3r Yes. Thank you! Btw, do you know how to use .fbx file? I've downloaded some from https://www.mixamo.com, but it seems each contains only one model and one animation, I want a zombie to walk and idle, how do I output the file I want?
  7. I've already downloaded babylonjs and babylonjs-loaders files, so I should not need to request any file from assets.babylon.com/ But somehow the project still trying to load https://assets.babylonjs.com/environments/environmentSpecular.env I don't know why and how to prevent it, I've download the file already, but don't know how to use it.
  8. Opening babylonjs page on my iphone, it seems CPU usage is always above 70% and the device overheated in a minute, battery life dropping very fast as well. And I'm just rendering some basic scenes without any animation or particles, what did I do wrong? And maybe how to optimize?
  9. There are 360 photos everywhere, but I can't seem to find good skybox textures, where do you guys recommend to find skybox photos?
  10. The result is fantastic, but I'm afraid the code is too complicated(and long) for me to understand how do you do it. Could you please explain a little bit about the core concept to achieve this? Thank you. @Gijs Also, I find that the scene inside outer box is just a ground, is it possible to have a skybox inside the transparent outer box?
  11. I was using videoDome to presenting 360 video. The first time loading on Mac took only sometime, but on my iphone 8, it took forever to load, even after loading it lags so much, doesn't even respond to gestures. Is it normal? Or did I do something wrong? How would you usually optimize scene with video assets?
  12. Haha, I'm not native speaker, thought ppl meant people... my bad. Thank you for your humor Just dive in this whole new area, always wonder what experienced developer use, regarding to assets. Btw, a random question, can you trigger something in the middle of an animation? Like if at the end, there's a callback onAnimationEnd. But say if I want to do something when an animation plays to frame 120, how do I do it? @Dad72
  13. What do ppl usually use? .babylon file? @brianzinn Thank you! I didn't know you could use let model = scene.getMeshByName("__root__"); to get the model. 1. Now I want some animation for the whole model (usually consist of more than one mesh), but I couldn't do it, can you help to check this sandbox: https://codesandbox.io/s/91n29pnqko ? 2. Also, I'm wondering if you load more than one assets into the scene, you can't use let model = scene.getMeshByName("__root__"); every time right?
  14. @Tomek @ssaket Thank both of you! While you were at it, the sword is shiny in sketchfab page https://sketchfab.com/models/b91d50762282401cacbdbf8e563f8a4c, but when I load it to the scene, it looks so dark and ugly... How do I usually fix this kind of problem? Should I just guess what the environment light maybe? And also do you usually download assets from sketchfab, or just build your own?
  15. It is pretty weird I've never be able to load and present .gltf assets in webpack setup. Using simple html + js, I can do as tutorial to pull it off like in this demo https://codesandbox.io/s/xlox878mwp But if I'm using a React.js template (basically any webpack setup), there's always erro: the asset can't be find / unexpected token in JSON. Like in this one https://codesandbox.io/s/8l2xlq27x0 Why, and how to solve it? Big thanks!
  16. new Ray(origin: Vector3, direction: Vector3, length?: number): Ray is how you create a ray. Basically I want to draw a ray from camera to the center point of the screen, and cast that ray to see if it hits any mesh. Origin is the position of the camera, but I've got no idea how to calculate direction, since center of the screen is a (x,y) not a (x,y,z)...
  17. Thanks, really cool demo. But it feels like not exactly what I want... 1. About the aim, I kinda think of a normal shooting game, where there's an aim drawing on the center of the screen. So whenever you press a key, if anything in the babylon 3d world is on the aim, it will be shoot down. So it is not a mouse moving onto the target thing (so not onPointerOverTrigger)... what I find confused is that aim is not the pointer, so I don't know what api to use. Edit: I find raycaster maybe what I what to use, but still have no idea how to create a ray from camera to the (x,y) point on dev
  18. How to load a videoDome without showing it right away? I kinda need to load the video for videoDome first while playing along with other scene, then at the end of a sequence of animation, videoDome will show gradually (alpha from 0 to 1) I looked around the api but couldn't find anything, is this possible to do in Babylon.js?
  19. 1. Want to build a ball with texture, and if shown on phone, you can touch and swipe the ball, ball will spin according to your swipe direction. Is it possible on Babylonjs? 2. Also if I draw an aim (a cross) in center of the screen, is it possible to know if the aim "hits" any mesh? I know pointer can do that by looking into pickInfo.hit, but is it possible for a fix point on the screen (knowing its clientX and Y) which is not the pointer?
  20. 1. I notice every ball has a "long tail" behind it, is this a concern? 2. About coding style and performance: say the whole scene consist of 3 stages. Is it better to add 3 onBeforeRenderObservable, each doing exclusive the animation on its stage; or is it better having one gigantic onBeforeRenderObservable and putting all the code in there? 3. With the help of deltaTime and a timer, I find onBeforeRenderObservable can cover all the cases of animation, do we still need beginAnimation? What in your working experience is the case?
  21. Thank you! I've got questions: 1. How reusability works in your description? I thought reusing means you create and recycle 1 or maybe 5 meshes. But in this case, we create them all upfront, how's that gonna benefit perf? 2. If there aren't max number for meshes(they spawn infinitely), but I'll disable all those who get closer enough or hit the camera. How to code in this case?
  22. Big thanks! This works just fine for me. Another question, how do you spawn those meshes once every second? Every example I find, meshes all exist at the very beginning.
  23. Thanks, @JohnK btw, should I create all the mesh needed and set the unused ones to invisible till later, or should I create things out on the fly? How do I do it in later case? It seems to me that I can only animate properties, so I can't just meshBuilder a mesh at the end of an animation?
  24. How to create a mesh that's always approaching closer to your camera? I've got a universalCamera that you can move around using arrow keys, I kinda what enemies(meshes) spawn around the camera position, and always move towards camera, how do I do that?
  25. I notice we have a scene.registerBeforeRender(function() { }) function for inserting your animations. In a complex scene, where 1. everything start from a trigger action 2. they play in sequence, and the next one started when the first one play to a certain frame 3. more animations needs to be waiting for another trigger 4. some needs to play after assets loaded, and some assets will be loaded after trigger action should I be putting all the animation inside registerBeforeRender ? Is it even possible? I find my animation code everywhere, what is the b
  • Create New...