Sign in to follow this  

Star Sphere w/ particle sustem

Recommended Posts

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.

Share this post

Link to post
Share on other sites

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:

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.