Browse Search Popular Register Upload Rules User list Login:
Search:
[DISORIENTING] Space Camera Test

Image:
screenshot of the scene

Author: UnityDogGaming04

Group: Default

Filesize: 6.56 kB

Date added: 2021-10-08

Rating: 5

Downloads: 934

Views: 192

Comments: 1

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

This scene contains a few static planets that pull in the player, as well as some fancy scripting that rotates the camera to put the nearest planet below the player!
The code checks on every running frame if planet 0 is closest, and if it is, align the camera to planet 0. It does the same with planet 1 and 2. I didn't like the sharp disorienting transition from one zone to another, so I added a lerp function to smoothen it out. However, on the west side of any planet, this caused an annoying rotation that wasn't necessary. This is caused by the fact that angles range from -pi to pi, and when crossing instantly between the two, the lerp works in the direction oppposite where it should go. So I set the transition value in the lerp to 1 and added a bend axle attached to a circle. This was sufficient to remove the sudden 360 rotation.
The code is not optimized; it could be more efficient, But since it only compares 3 elements in this case, it isn't that big a deal.

CONTROLS:
W - accelerate the player toward your mouse
Last edited at 2022/04/03 19:27:45 by UnityDogGaming04
Please log in to rate this scene
edit
Similar scenes
Title: The desert (Object following camera test)
Rating: 5
Filesize: 39.83 kB
Downloads: 1123
Comments: 0
Ratings: 1
Date added: 2021/05/22 02:01:57
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: READ DISCRIPTION
Rating: 4.7273
Filesize: 138.79 kB
Downloads: 831
Comments: 3
Ratings: 5
Date added: 2009/07/19 23:17:07
Made with: Phun
Rating: rated 4.7
download
Title: Space Cave Game [Test field]
Rating: 5.625
Filesize: 300.22 kB
Downloads: 1601
Comments: 3
Ratings: 2
Date added: 2018/08/30 12:33:34
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
Title: Camera that Uses no Globals
Rating: 5
Filesize: 34.19 kB
Downloads: 1134
Comments: 5
Ratings: 1
Date added: 2021/10/18 00:35:26
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Car Camera test
Rating: 5.625
Filesize: 201.28 kB
Downloads: 1585
Comments: 3
Ratings: 2
Date added: 2016/02/09 01:05:40
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
Title: Crosshair
Rating: 5
Filesize: 34.46 kB
Downloads: 293
Comments: 1
Ratings: 1
Date added: 2018/10/02 05:47:19
Made with: Algodoo v2.1.0
Rating: rated 5
download
Its so cool!
I love it!