Pryme8 Posted July 12, 2018 Share Posted July 12, 2018 https://www.babylonjs-playground.com/#WBQ8EM#12 I am trying to figure out how to generate a particle "star sphere" I don't have much time today to dink around with it so I was hoping that someone could help me out. Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 12, 2018 Share Posted July 12, 2018 system* ... also the playground won't load for me... not sure why... maybe something with moving the spawn point of the particles I would guess...? Except instead of making it a circle make it a star... assuming thats what you meant... I can't really tell... oh like looking out into the stars maybe? then make the position follow a sphere code... ParticlesA.startPositionFunction = function(worldMatrix,positionToUpdate){ var rndAngle = 2*Math.random()*Math.PI; var randX =this.minEmitBox.y; var randY = radius*Math.cos(rndAngle) var randZ = radius*Math.sin(rndAngle); ParticlesA.direction1 = new BABYLON.Vector3(0,-randY*2,-randZ*2); ParticlesA.direction2 = new BABYLON.Vector3(0,-randY*2,-randZ*2); BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate) }; Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted July 12, 2018 Author Share Posted July 12, 2018 https://www.babylonjs-playground.com/#WBQ8EM#13 Ive got it but for some reason on my local version the line: sphereEmitter.radiusRange = 0; Is not restricting the particles to the surface of the emitter. Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 12, 2018 Share Posted July 12, 2018 10 minutes ago, Pryme8 said: https://www.babylonjs-playground.com/#WBQ8EM#13 Ive got it but for some reason on my local version the line: sphereEmitter.radiusRange = 0; Is not restricting the particles to the surface of the emitter. Maybe set it to -0.1 or something slightly outside? or play with the numbers to extreme (-1/1) to see if its actually sphereEmitter.radiusRange that is the problem... Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted July 12, 2018 Author Share Posted July 12, 2018 fixed, I was pointing to the wrong CDN for the bjs file and was using an older one. GameMonetize and DylanD 2 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.