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.

DarkBASIC Professional Discussion / smooth camera movement

Author
Message
ssj3_shadow
22
Years of Service
User Offline
Joined: 12th Jan 2003
Location:
Posted: 27th Jul 2005 09:27
(see source provided)
using the arrow keys repositions the camera from the defult position
this change is instantanious, having the camera appear in the new location.
does anyone know how i can have the camera slowly move and rotate from its old position to the new position.
changing the "jump" to a "move to" function

any help whould be appreciated

w00t -what does it mean?
Jedi Knight
20
Years of Service
User Offline
Joined: 15th Oct 2004
Location: California
Posted: 27th Jul 2005 12:06
I believe there is such code available in the online Code Database. It's based on the idea that a set of values gradually approach their destination values. Just search "smooth" in the database and you should be able to find it.
Pheonixx
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Columbus, Ohio
Posted: 27th Jul 2005 13:28 Edited at: 27th Jul 2005 13:29
do

set camera to follow cameraid,targetx,targety,targetz,yrotation,followdistance,yoffset,smoothing,collisionflag

point camera cameraid,targetx,targety,targetz

loop

targetx,y,z is what you want to follow
yrotation spins the camera around the object
followdistance is how far back from the object you are
yoffset lifts the camera up or down
smoothing is from 100 (maximum) to 1 (little)
and a collision flag of 1 will prevent the camera from moving if it hits a collision object.

if you don't point the camera, the camera will look flat acrross the xz plane.

http://ausukusa.breakset.com
Supremacy
21
Years of Service
User Offline
Joined: 30th Dec 2003
Location:
Posted: 27th Jul 2005 13:29
ssj3_shadow: alternativly, you can mess with newtons fisics sdk, and aplly forces to objects and camera, thus eliminating the "repositioning" your talking about.

Your signature has been erased by a mod

Thank u modddddd..........
ssj3_shadow
22
Years of Service
User Offline
Joined: 12th Jan 2003
Location:
Posted: 27th Jul 2005 21:12
i already have the camera set up to change positions eg. the standard camera is 3rd person, and pressing the uparrow changes to first person, is ther a way to make this transition a smooth change ie in this example have the camera slowly zoom in untill it was in first person mode. does any one know how th alter the code provided to acheive this smooth transition from one camera position to another?

w00t -what does it mean?
Drew Cameron
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 27th Jul 2005 21:51 Edited at: 27th Jul 2005 21:52
Yes, look into the curvevalue command - don't know it off by heart.

I use that in my games all the time, the command was designed for things like this.


Katie Holmes does not endorse D&C or Drew Cameron.
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Jul 2005 22:34 Edited at: 27th Jul 2005 22:36
CurveValue and also Curveangle are what you need. You tell it where you are, where you want to be, and how quickly you want to get there.

The Assets and Templates Tutorial in issue 29 uses curveAngle for the camera, combined with set camera to follow

http://www.thegamecreators.com/data/newsletter/newsletter_issue_29.html

Pheonixx
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Columbus, Ohio
Posted: 27th Jul 2005 23:27 Edited at: 27th Jul 2005 23:32
why make things so complicated. all you have to do is change the followdistance and yoffset values to zero, adjust your camera minimum range to remove clipping with your playerobject, and set the point camera coordinates towards a vector in front of the player. A smoothing value of about 25-50 should make a nice smooth and quick change.

if you want to have some kind of accelleration or deccelleration to how fast the camera repositions... just decrement the smoothing value over time, and the camera will move faster and faster.

http://ausukusa.breakset.com
ssj3_shadow
22
Years of Service
User Offline
Joined: 12th Jan 2003
Location:
Posted: 29th Jul 2005 06:24
ok i've updated the code, it works fairly well, could any one help make it work 100%
i have adopted teh suggestion of Pheonixx (thanks), this works for to my liking for all camera angles except for the shoulder camera sub, when run the camera still appears at the shoulder, but slowly returns to where it was, this is ok but i need the camera to slowly move to the new location as well as slowly move back into its origional position, also as you will see as it runs, the sholder camera is in the wrong position untill you move the character this is a side effect of using Pheonixx suggestion.

any help making both transitions into sholder cam smooth not just the return move, and any ideas why the camera is in the wrong position untill i move the model
(see stand alone source provided)

w00t -what does it mean?
ssj3_shadow
22
Years of Service
User Offline
Joined: 12th Jan 2003
Location:
Posted: 30th Jul 2005 04:40
Can anyone help with this last minor problem?

w00t -what does it mean?

Login to post a reply

Server time is: 2025-06-02 13:58:39
Your offset time is: 2025-06-02 13:58:39