1 registered members (tomaslolo),
1,542
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
smooth(camera.pan)
#343349
10/05/10 18:56
10/05/10 18:56
|
Joined: Apr 2008
Posts: 650
Sajeth
OP
User
|
OP
User
Joined: Apr 2008
Posts: 650
|
Hello folks, how can I smooth a camera.pan value with the smooth function without getting those twists as soon as the value changes from -180 to 180 and vice versa? Tried different things, including a reset of the smooth function on each "big jump", but this has the side effects of causing camera "hickups". Regards
Teleschrott-Fan.
|
|
|
Re: smooth(camera.pan)
[Re: MasterQ32]
#343351
10/05/10 18:59
10/05/10 18:59
|
Joined: Apr 2008
Posts: 650
Sajeth
OP
User
|
OP
User
Joined: Apr 2008
Posts: 650
|
Always turned towards a specific actor, set by vec_to_angle If theres no feasible way, I'll have to find a workaround...
Last edited by Sajeth; 10/05/10 19:00.
Teleschrott-Fan.
|
|
|
Re: smooth(camera.pan)
[Re: Superku]
#343355
10/05/10 19:34
10/05/10 19:34
|
Joined: Apr 2008
Posts: 650
Sajeth
OP
User
|
OP
User
Joined: Apr 2008
Posts: 650
|
if(abs(camera.pan-oldcampan)>100)
{
if(camera.pan>oldcampan)
oldcampan+=360;
else
oldcampan-=360;
}
camera.pan = camera.pan * (1-CAMERASMOOTHFAC) + oldcampan * CAMERASMOOTHFAC;
oldcampan=camera.pan;
Probably the most dirty way to pull this off... But works just fine.
Teleschrott-Fan.
|
|
|
Re: smooth(camera.pan)
[Re: Superku]
#343358
10/05/10 19:43
10/05/10 19:43
|
Joined: Apr 2008
Posts: 650
Sajeth
OP
User
|
OP
User
Joined: Apr 2008
Posts: 650
|
Ehm... did you try my code? Yep - and thanks for that - but yours reacts pretty choppy, and I figured easiest way going would be to kind of recode the smooth()-function. Thanks anyways
Teleschrott-Fan.
|
|
|
|