particle-system

Have particle emitter trail follow finger path in spriteKit

二次信任 提交于 2020-01-11 02:36:09
问题 I have created a particle emitter in Xcode that has quite a lengthy trail. When i move it inside of the particle generator it leaves a trail following my mouse path. some background info on my goal: In my spriteKit game the user drags their finger around the screen to shoot moving objects. I am attempting to create a "Bullet Time" effect where the objects slow down and highlights when the current finger location touches them. When the finger stops moving or they run out of ammo the

Three.js Transparency Errors With Multiple Particle Systems Sorting

北慕城南 提交于 2020-01-06 06:59:09
问题 I have two THREE.ParticleSystem systems with particles that have textures with alpha transparency, one is using AdditiveBlending (fire texture), the other uses NormalBlending (smoke texture) and they use simple custom vertex and fragment shaders. Each ParticleSystem has "sortParticles = true" and independently they work perfectly, however when both types of particles overlap the first particle system (fire texture) has a similar transparency depth error that is normally associated with

Check iOS XCode Project Files: openGL Particle Emitter for GLKit

守給你的承諾、 提交于 2020-01-06 03:50:08
问题 I am trying to port the Particle Emitter by Michael Daley to GLKView and found a XCode project where he did this on github - unfortunately heavily bound inside a nice little game. Now I tried to take only the particle emitter out of his game project to reuse it (I need it in 2D) and I made it up to a state without any compile error - but couldn't see nothing... Here is the project file. Could anybody tell me why there is no particle emitter visible? thnx! 来源: https://stackoverflow.com

Efficiently making a particle system without textures

会有一股神秘感。 提交于 2020-01-03 04:53:07
问题 I am trying to make a particle system where instead of a texture, a quad is rendered by a fragment shader such as below. uniform vec3 color; uniform float radius; uniform float edge; uniform vec2 position; uniform float alpha; void main() { float dist = distance(gl_FragCoord.xy, position); float intensity = smoothstep(dist-edge, dist+edge, radius); gl_FragColor = vec4(color, intensity*alpha); } Each particle is an object of a c++ class that wraps this shader and all the variables together and

Should I use Pools for particles if i forced to re-init every particle every time i create them

一曲冷凌霜 提交于 2020-01-02 06:27:14
问题 I am creating a particle system in XNA4 and I've bumped into problem. My first particle system was a simple list of particles, whose instances are created when needed. But then I read about using pools. My second system consists of a pool, filled with particles, and an emitter/controller. My pool is pretty basic, this is the code: class Pool<T> where T: new () { public T[] pool; public int nextItem = 0; public Pool(int capacity) { pool = new T[capacity]; for (int i = 0; i < capacity; i++) {

Having trouble calculating direction for particle explosion

£可爱£侵袭症+ 提交于 2019-12-25 09:36:14
问题 I'm trying make a particle explosion system, where each particle explodes directly away from a central point. But I'm getting some really funky behavior. I'm using Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI; to calculate the direction to the center point, then reversing the direction by subtracting 180 degrees from the angle. Here's the rest of my code dealing with the particles: for ( var i = 0; i < le.length; i ++ ) { // Create new particle element and append it to document. lObj[i] = new

playing particle system in Unity

限于喜欢 提交于 2019-12-25 01:08:57
问题 I am using Unity3D to develop for the HTV Vive using SteamVR. I have downloaded an asset from the asset store with explosion effect created using a particle system. I want to play the particle animation when an object is destroyed. Here is the code I am, unsuccessfully, using. private void OnDestroy() { explosion.GetComponent<ParticleSystem>().Play(); } Explosion is a public variable of type GameObject set from the inspector. I drop the particle system object there. Why is it not working?

Particle animation for iOS

强颜欢笑 提交于 2019-12-23 23:31:10
问题 I'm in need of particle animation in my UIView -based 2D game. At present I'm using an array of images for particle animations. This makes my app size increase, and sometimes leads to memory leaks. Is there is any way to make particle animations using Core Animation? 回答1: cocos2d (see http://cocos2d-iphone.org/) is a framework for developing 2d games for iPhone. The source code for many examples include some particle animation demo's. 回答2: There are some nice examples how to do this in the

How to create lines between nearby particles in ThreeJS?

落花浮王杯 提交于 2019-12-23 15:43:32
问题 I have been able to create a particle system for canvas, which was simple and effective. Here is a demo: https://awingit.github.io/particles/ Now what I would like to do is create the same thing in Threejs. However, I have not yet found any examples out there to reference from and I have not been able to create the same as my 2D canvas particle system in 3D. Can anyone give me some direction with regards to how I can do this in Threejs? I know how to work with particles, but what I am