Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing angularAlignVelocity for emitters not at origin #33

Closed
wants to merge 1 commit into from

Conversation

AndrewRayCode
Copy link
Contributor

Before the angle was always pointing to the origin. Addresses issue #29. Heyo @stemkoski - can you review? (it works if he is afk)

Before the angle was always pointing to the origin. Addresses issue squarefeet#29
@squarefeet
Copy link
Owner

I did exactly the same thing last night and it didn't work for me... Let me experiment again and I'll get back to you on this.

@squarefeet
Copy link
Owner

Yeah, sorry... this approach doesn't work :(

FYI: Just tested on Chrome 32, OSX 10.9.

@squarefeet squarefeet closed this Jan 24, 2014
@AndrewRayCode
Copy link
Contributor Author

What does "doesn't work" mean? It corrected the behavior in my game. Are you changing the z position of the emitter? that's the only thing I didn't try.

@squarefeet
Copy link
Owner

The angles aren't aligned properly for the following settings:

type: 'sphere',
position: new THREE.Vector3(20, 0, 0),
radius: 20,
speed: 5,
colorStart: new THREE.Color('white'),
sizeStart: 5,
sizeEnd: 0,
particlesPerSecond: 5000,
angleAlignVelocity: 1

Taken whilst camera was circling 0,0,0 on x and z axes:
screen-shot-2014-01-26-at-11 23 51

With static camera at 0,0,0
screen shot 2014-01-26 at 11 31 54

@squarefeet
Copy link
Owner

FYI: I made this test by modifying the sphere example - just changed position to 20, 0, 0

@AndrewRayCode
Copy link
Contributor Author

maybe it "works" for me because my perspective is always top town. I'd imagine that to get actual alignment in a true 3d sphere, you would have to actually rotate the particles, not do it in the shader. Can you actually rotate particle geometry? Otherwise in the shader you'd have to take in to account camera position (I think) and pespective matrix (I think?) and do some other fun math.

@squarefeet
Copy link
Owner

Ah yeah, that might be why it works for you. @stemkoski and I discussed this very problem a while back - he had the same idea re. camera pos and matrices :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants