Sign in to follow this  
Pryme8

Star Sphere w/ particle sustem

Recommended Posts

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)
 
};

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.