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 / Camera runs

Author
Message
Silicon Zombie
16
Years of Service
User Offline
Joined: 7th Oct 2007
Location: UK
Posted: 25th Nov 2007 20:12
I am probably being thick, but I am trying to do a looped camera run around an object (zooming towards the object every so often)

Now the way Ive tackled this issue is to have a loop that takes or adds values to the possition camera command until it gets to a certain place and then with a IF camerazpos=-4 then ......

This works reasonably well but the camera run function is now a mess of if statements and I was wondering, is there an easier way to tackle the camera run issue? am i being lame?

Thank you.
MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 25th Nov 2007 21:04 Edited at: 25th Nov 2007 21:05
If the problem is that your zoom code is a mess, replace it with:



where distance_from_object is how far back you will move the camera;
median_distance is your average distance from the object;
a is a looping value between 0-360, which returns -1 to +1;
zoom_speed is the speed at which a (and the zoom) changes;
zoom_range is how close/far away from the median_distance the zoom can get.

After that, point the camera at the object, then move the camera by -distance_from_object.

EBA; FUI; Mario Land Ripoff.
Every time you post a joke in the form of code, mace yourself.
Silicon Zombie
16
Years of Service
User Offline
Joined: 7th Oct 2007
Location: UK
Posted: 25th Nov 2007 21:28
Thanks so much....thats exactly what I needed.

A page of IF's was no fun to work with!!!

Thankyou!

Login to post a reply

Server time is: 2024-09-27 08:19:42
Your offset time is: 2024-09-27 08:19:42