Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Starshower Particle Camera help

Author
Message
Red And Blue Eyes
20
Years of Service
User Offline
Joined: 20th May 2004
Location:
Posted: 30th May 2004 19:50 Edited at: 30th May 2004 20:05
I am a beginner like working with graphics command now i am learning particles in DBP made a intro but cannot get a good camera position for my starshower effect it looks like stars falling down and then going forward i want the cammera move forward then backword by it self if you know how please help i need a good camera command i only know how to move a camera in a circle

you will need only a picture of a star size of an icon or smaller
and a small sprite picture

i have paste source code below
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 31st May 2004 16:03
For the future, try not to include ANY media if you can help it, people are much more willing to help if they can just run the code without any hassle.

I think this is what you were looking for. If you know how to move the camera in a circle, then moving it in and out should be easy to understand. You just use another angle, and sin() again...



As the angle increases, sin goes from 1 to 0 to 1 to 0 smoothly, in a sine wave (you may already know), so then if you times that by a value and add it onto the radius, you will get a smoothly increasing and decreasing radius, which results in a zooming camera. I also included wrapvalue() which wraps the angle around to 0 if it reaches 360. This stops the value getting rediculously high.

Also, in the future use "sync on" and "sync". If you use sync on, it tuns manual screen refreshing on, so the screen only refreshes when you use "sync". This can make the screen seem smoother. "sync rate" sets the maximum frames per second.

Hope I helped.

Athelon XP 1600+/Radeon 9600 Pro/256 RAM
Red And Blue Eyes
20
Years of Service
User Offline
Joined: 20th May 2004
Location:
Posted: 31st May 2004 20:14 Edited at: 31st May 2004 21:40
Thanks for your advice hamish and your code helped me a lot thanks

Login to post a reply

Server time is: 2024-11-26 19:38:07
Your offset time is: 2024-11-26 19:38:07