#### Archived

This topic is now archived and is closed to further replies.

# Putting Particle engine into 3D envionment

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

## Recommended Posts

the latest tutorial I have read is the particle engine tutorial of which is very cool so I altered it to my own needs (I will write my own but I feel the best way to learn this kinda thing is to take the tutorial and mess with it till you understand it). I took out alot of the keyboard interaction and speeds/colors etc cause all I want is red particles floating up making a fire effect. But, when I made it so I could scroll around the particles you can see that they are only 2D polygons. Now, with abit of thought you could design it so that all the particles rotated to face you (probly) but when I want to put it into a 3D world (where walking forward requires sin/cos relating to the turn angle) I can''t think how to implement this. Does anyone have any ideas ? Thanks

##### Share on other sites
That''s the same I''m trying to do. That''s also the same problem I''m having

I guess you''d have to somehow make the particles rotate and translate so they get on screen like the rest, but also an additional ModelView matrix that ''undoes'' the rotation by the Projection matrix... Geddit?

I''m working on it now. If I find a fix, I''ll mail you. If you do, please mail me...

Bye!

##### Share on other sites
Its a deal. I tried working it out, but with a different object. I placed a bitmap, mapped onto a 2D QUAD but obviously when I walk around it, it appears like a piece of paper. My idea was to use trigonometry but I had too many variables. I could calculate the distance between the bitmap, my original position, and the distance between my original position and my new position. But i needed the third side to use the cosine rule to get the angle. This probably makes no sense but I''m crud at explaining. THere is probably an easier way.

When you play 3D games, often you will see a 2D light source object that always faces the screen, so there must be some way to do it.

##### Share on other sites
You might want to check out on ''billboarding''. It basically rotates someing so that it faces the camera.

##### Share on other sites
is this a general programming topic? Is it in any of the Nehe tutorials ro could I find it in a search engine?

Thanks

##### Share on other sites
Hey Clouds3000, check this:
http://nate.scuzzy.net/docs/billboard.html

##### Share on other sites
Well a Bill Board is simple if your using Direct3D you can just us Point Sprites There part of the Direct3D Intorface and run really fast..

but if your useing OpenGL you need to rotate the Vertects by The invers of the camera Rot on all 3 Planes..
hehe
i would but some code up but i dont have any (I use Direct3D)

-VBLimits
www.VBLimits.com

1. 1
Rutin
34
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633331
• Total Posts
3011399
• ### Who's Online (See full list)

There are no registered users currently online

×