# Calculating start points in particle engine

This topic is 4547 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am creating a thruster for my spaceship using particles. I have the xyz describing the center of the emitter [cvector emitterPos]. The xyz which is the direction the thruster is pointing and the particles should be heading [cvector direction]. Also I have a float radius of the engine [float coneRadius]. The idea is particles are created at a rondom point on the base of a cone which is based at the emitter [emitterPos] with the pointy tip part of the cone being [direction]. So the bottom round part of the cone is centered at emitterPos, with a radius of float coneRadius. If you follow that, how do I ascertain a random point on that circle plane with is at the base of the cone? I need to position my particles at this random base position once it dies and needs to be recreated. Any help with this is appreciated, I can't quite work it out in my head.

##### Share on other sites
Again I say, wrong place.
The Physics and Maths forum has a purpose, utilize it.
Here, only OpenGL API specific questions only.

##### Share on other sites
But, this is in Physics and Math forum afaik...

and to your question: you mean.. like particle distribution? just add +- random amout of tolerance TO DIRECTION and you will get particles shot in cone shapes.

##### Share on other sites
Ok, the first thing is to get a random point inside a circle. To do that, we get a random radius (between 0 and coneRadius/2) and a random angle (between 0 and 360°). Ok, the coordinates of this, suposing the circle is aligned with the xy plane, would be x = randomRadius*cos(randomAngle), and y = randomRadius*sin(randomAngle).

Ok, the tricky part now is to get this aligned with the cone you have... I'm pretty shure there's a simple matrix multiplication that will magicaly solve this, but I never really understood how matrices worked, so I'll need some more time to think about it (no warranties I solve it tought). One I had and very similar problem, with the same solution I believe, but unfortunely I've lost my files some time ago.

Hope this little bit helps you

EDIT: Well, here's what I found so far: http://en.wikipedia.org/wiki/Rotation_matrix
Anyway, maybe an easier way to solve this would be to use OpenGL (I'm assuming your using this, but I think DirectX has it to) own rotation function to do this - but I don't remember how to do it

[Edited by - algumacoisaqualquer on July 2, 2006 4:10:40 PM]

1. 1
2. 2
3. 3
Rutin
13
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633700
• Total Posts
3013419
×