Search the Community

Showing results for tags 'solved'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • 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 1,098 results

  1. So if one was to extrude something that needs to make a 90 degree turn what would be the best method. want it to be like two 45 degree miter cuts that are joined. https://www.babylonjs-playground.com/#WGTQ6E#1
  2. Implementing click navigation. Trying to get skeleton animations & path navigation to work nicely together. I start the player walkAnim and then begin animating player.position along a path. The walkAnim is promptly interrupted and the player glides along the path, after which he continues walkAnim for a short time. I considered moveWithCollisions, but It navigates to a point, not an array of points, I would have to loop over the path array and check whether or not Ive reached a point, then moveWithCollisions to next point in path. Starting to feel out of my league so decided to share my woes with all you. The bablyon-nav-mesh file require()'s alot of dependencies and I was unable to import the library into a playground ( https://www.babylonjs-playground.com/#EZSYWY#1), so I'm just gonna post some code here. BABYLON.SceneLoader.ImportMesh("","https://rawgit.com/Spankyed/sched-proto/master/src/assets/player/","dummy3.babylon",scene,(meshes,particleSystems,skeletons)=>{ var skeleton = skeletons[0]; skeleton.enableBlending(0.2); player = meshes[0]; player.skeleton = skeleton; player.position = new BABYLON.Vector3(-2.7426157086231813, 0.32968033243017736, -5.410392414960055); player.checkCollisions = true; canvas.addEventListener('click', function(event) { var pickingInfo = scene.pick(scene.pointerX, scene.pointerY); if (!pickingInfo.hit) return; var walkRange = skeleton.getAnimationRange("YBot_Walk"); var walkAnim = scene.beginAnimation(skeleton, walkRange.from, walkRange.to, true); var path = navigation.findPath(player.position, pickingInfo.pickedPoint, 'level', navigation.getGroup('level', player.position)) || []; console.log('path', path) /*if path is defined, create path animation frames and beginAnimation on player*/ if (path && path.length > 0) { var length = 0; var direction = [{ frame: 0, value: player.position }]; for (var i = 0; i < path.length; i++) { length += BABYLON.Vector3.Distance(direction[i].value, path[i]); direction.push({ frame: length*100, value: path[i] }); } for (var i = 0; i < direction.length; i++) { direction[i].frame /= length; } var move = new BABYLON.Animation("CameraMove", "position", 180/length+10, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); move.setKeys(direction); player.animations.push(move); scene.beginAnimation(player, 0, 100); } }) engine.runRenderLoop(function(){ scene.render(); }); }); While I'm here wanna throw out two other questions I have yet to conceive an answer for. How to smoothly adjust the player to lookAt points along its path? How would key controls(wasd) be implemented in conjunction with a click navigation system? Create small incremental paths?
  3. Hersir

    UVs from 3d max

    Hi, have question regarding 3d max export. I created rectangle plane in 3d max. Than tried to add custom shader material to it, and realised that uv.y is out of [0-1] range. void main(void) { if(vUV.y > 0.5) { gl_FragColor = vec4( 1.0, 1.0, 0.0, 1.0); } else { gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0); } } After checking exported babylon file saw that uv.x is from 0-1 but uv.y 1-2 [0,1,1,1,1,2,1,2,0,2,0,1] Some scaling could be applied? Is that desired behaviour ? Thanks.
  4. DylanD

    GUI 2d shapes

    Hi everyone, I was wondering if I a image in Babylon's GUI could is there someway to slowly colour it? Like a progress bar, where as the player completes something or as time goes on a bar goes form outlined in green to slowly being filled with green to filled with green. Heres a playground I made with objects that illustrates what I want, however I'm hoping I could do this in the GUI and with just one object the slowly changes colour from one side to the other. http://www.babylonjs-playground.com/#F84J26 Any ideas? Thanks, have a good Day
  5. https://www.babylonjs-playground.com/#MU17PR#8 If you pan the camera up and down, you will notice a juggling/glitch effect of the reflections or refractions (not sure) jumping around when you have a "glass" material with a inside surface and outside surface. *UPDATE* Maybe its not so much PBR thing as a depth fighting thing? the environmental intensity is set to 0 on this and a hemiLight is turned on to make it simpler to see. https://www.babylonjs-playground.com/#MU17PR#17
  6. Looks like the obj loader is not finished loading material when the BABYLON.SceneLoader.ImportMesh() onSuccess function is called. see https://github.com/BabylonJS/Babylon.js/blob/master/loaders/src/OBJ/babylon.objFileLoader.ts#L231 I need to make changes to the mesh material after the mesh is loaded by the obj loader. How would i know when the obj loader is done loading the material? what is the most reliable method for doing that?
  7. Hey, i am trying do write text on a mesh. The text should only appear on the top side of the mesh. centered and also in the reading direction. I just played around and this is what i got so far: https://www.babylonjs-playground.com/#XCPP9Y#549 Its kinda buggy and i need ur help.
  8. Hey all, it is not ideal but I would like that answered topics would be flagged as solved using tags (like this topic). To add a tag, you have to edit the first post you made to start a topic. Thanks a lot
  9. Hi guys, I would like to know if the each PostProcess creates internally a new render target texture and never reuse what could be potentially reused? Normally we could just use two or three render targets and play ping-pong with them to finish the whole post process. Is it doable? Thanks
  10. Strange flickering on a glTF mesh with DefaultEnvironment www.babylonjs-playground.com/#T7A2L7#3
  11. DylanD

    Animation Curves

    Hi again everybody, I was wondering if anyone knew how to export Unity animation curves into something compatible with Babylon's/typescript. Or something similar to animation curves. I know about making animations and setting them to scenes and what not but I don't understand how exactly that gradually works anyway. I guess my questions are: 1: Is it possible to use a animation curve made in unity in Babylonjs/typescript? 2:Is there something similar to animation curves in Babylonjs/typescript? 3: How exactly does an animation in Babylonjs make things gradual?(below for more on this)? Any ideas? keys.push({frame: 0,value: -Math.PI/12}); keys.push({frame: 5,value:0}); keys.push({frame: 10,value: Math.PI/12}); I have this code for an animation and it gradually goes from -Math.PI/12 to Math.PI/12, but how, linearly or something else? Thanks for your time!
  12. Hello ! As WebGL2 comes with new texture formats, I decided to play a bit with them, and it seems to work well in pure WebGL2: https://playground.babylonjs.com/#RBQYSP (If it prints red, that means the RGB texture did work 🙂) I saw texture format has been added to createRenderTargetTexture function so I wanted to try it out. But whatever I do, I never achieve to create a RGB Render Target Texture. 😥 This code works to create a RGBA RenderTarget: https://playground.babylonjs.com/#RBQYSP#5 This code fails to create a RGB RenderTarget: https://playground.babylonjs.com/#RBQYSP#6 Framebuffer is incomplete. I already pulled the last version of BJS and added gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1) everywhere but it doesn't help much. I'm struggling with this, I don't understand where something is different from the pure WebGL2 version. I verified InternalSizedFormat, InternalFormat and TextureType and they're OK. If anybody has an idea... Thanks in advance 😊 PeapBoy
  13. Hi. I'm haveing an interesting new problem as usualy I hope. I'm haveing a babylonjs file which contain a few textures, but the textures are saved in one server and the babylonjs file in other server. And this babylonjs file is generated in one scene and used in other scene. When I;m using it in the second scene it's happening like in this playground. The engine try to get the texture from babylonjs file server + textures path. Now the question is. Can I avoid this in some way? maybe if the textures have link on it, take them from their link and not from babylonjs file path Thanks in advance for your help.
  14. Probably some easy question... but I've been struggling too long with the math. Does anybody know how to compute the Linear Velocity (world space) of a Circus Cannon Ball based on the Cannon Tube mesh orientation? In this case I use positive Y axis of cannon tube as 'forward', but in general I use the local Z axis as forward (to adhere to the definitions of BABYLON.Vector3.Forward() etc.). Once I know how to dynamically compute the (normalized) direction of the tube, I can then scale this vector with the cannon's shooting power (e.g. longer fire button press results in farther shooting). And add some random vector noise to make easy ball have a slightly different path each time. Please note that the tube is a child mesh on purpose so the orientation needs to be translated to world first. Here's the playground so far: http://playground.babylonjs.com/#R8ZH46 The solution to this question will probably be useful for anyone else who is creating some kind of ballistic shooter game (not first person). I noticed that all physics vectors are in world space only so therefore I am looking for these kind of transformations to roll up local mesh orientation to world physics direction. Thanks Q P.S. The cannon is set to auto-fire but you can use SPACE for fire as well, and [ and ] to turn the cannon.
  15. Me again, and I believe this is for @jerome again! I'm using the MeshBuilder to create a disc like this: var circle = BABYLON.MeshBuilder.CreateDisc("botCircle", { radius: 1, tessellation: 18, sideOrientation: BABYLON.Mesh.DOUBLESIDE}, this.scene); Now I would like to create another disc around the one above, with an inner radius of 1 and (outer) radius of 1.5 to get a shape that will 'extend' this disc, not overlapping it. Is there a feature to do that? If not I believe, I'll have to take a look at the CreateDisc implem and add my own... Thanks guys
  16. Hi, I'm looking at the GUI example here: http://www.babylonjs.com/demos/gui/ and wondering how I can scale the 2D elements to shrink as the camera zooms out (i.e. fixed sized relative to the mesh/3d context)?
  17. when doing something like this: var mat = new BABYLON.CustomMaterial("cMat",scene); mat.Fragment_Definitions( `uniform float time;` ) mat.Fragment_Before_FragColor( `color.r = sin(time);` ); how do I set the time float now? if it was a shaderMaterial it would be .setFloat but that is not an option here. I tried onBindObserverable.add(function(effect){ effect.setFloat... }) *EDIT* I found the answer. On one of @NasimiAsl's examples
  18. I am hoping someone can take a look at this, and let me know if I am using it wrong. I have 2 spheres that I have attached Rays to, they are both shooting at a target, and there is a large sphere in the way, called earth. When I change the position of the spheres, the pickedPoint that is returned by hitInfo on the Ray.intersectsMesh function seems to be giving me an incorrect Picked Point if my source has a negative Y position. The "source" ray is just fine, but the "alternate" ray seems to be getting a picked point that is on the wrong side of the earth. Any help would be appreciated, I put this in a playground so you can see what I mean. https://www.babylonjs-playground.com/#KNB069
  19. Hi, I am trying to set up falling particles and I am using typescript. So far I have been able to create particles but no make them fall. Code to make particles: var myPositionFunction=(particle, i, s)=>{ particle.position.x = (Math.random() - 0.5); particle.position.y = (Math.random() - 0.5); particle.rotation.y = Math.random() * 3.5; particle.position.y += 0.1; particle.checkCollisions = true; this.SPS.updateParticle(particle); }; this.SPS = new BABYLON.SolidParticleSystem("sps",this.scene,{updatable:true}); var model = BABYLON.MeshBuilder.CreateBox("m",{width:0.03,height:0.03,depth:0.03}, this.scene); this.SPS.addShape(model,100,{positionFunction: myPositionFunction}); var mesh = this.SPS.buildMesh(); model.dispose(); this.SPS.updateParticle = function(){ } Whenever I try to make the this.SPS.update function it gives me this error Type '() => void' is not assignable to type '(particle: SolidParticle) => SolidParticle'. [TSC] Type 'void' is not assignable to type 'SolidParticle'. They only way I've been able to get that error to go away is if I put it in the myPositionFunction and put particle as one of its parameters. I also can't find much on using Solid particle systems in typescript at all. Any ideas on how to fix this ?
  20. Hello, Is it possible to and if so, how do we suppress "Babylon.js engine (vX.X.X) launched" appearing on the console? Thank you,
  21. My question is in reference to audio tied to a mesh, so volume and panning are handled by the BABYLON engine. This works great for wav and mp3 audio files but lately I've wanted to use generators like tone.js to generate tones with javascript. It seems that BABYLON audio requires a URL to insert audio into the audio chain but is there any way to use the audio engine in BABYLON with tones generated with tone.js and the web audio API without rendering them to wav or mp3?
  22. Hello, Is it possible to make an incremental scene that is serialized. With exporters we can choose 'incremental', but with a scene that we serialize how does it go? Should we add to the scene objects export with incremental and serialize so that it is incremental?
  23. Hi, I've recently been asked to develop a project in webGL and after doing a research, finally I've choosed your awesome framework as the best option. After several tests, I cannot get a pure matte 100% roughness PBR Material with a HDR enviroment map (I've tried with different HDRs too). It looks like always too shiny even without any normal texture map. I've set up a playground trying to show you this issue. https://playground.babylonjs.com/#13290P Is it possible to get a more rough/matte material in this scenario? I've also noticed that without any normal/bump map applied, there are some hard transitions in the surface material (I've attached an image). Thanks in advance for your support.
  24. Hi, Probably there is a bug in occlusion queries - http://www.babylonjs-playground.com/#QDAZ80#15 Here a label is a thing that appears/disappears depending on the visibility of a sphere. I've noticed Occlusion Query takes into account only meshes that were created before it was enabled. If I add a box later - BJS doesn't understand that a sphere is behind the new box and my label stays visible. In my demo - in the beginning the label is not visible because the sphere is not visible, it's good. However, if you go to the right behind the box - label will always be visible. Is it normal and can be configured somehow or it's a bug?
  25. Hey Guys, i need a best practice for drawing text on multiple meshes with the same material. In my first attempt i created a StandardMaterial and DynamicTexture for each mesh and called the drawText method on the DynamicTexture. This works but it reduces the performance. The framerate drops till it become unplayable (browser freezes). I would be grateful if u have solution for this.