Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gilzoide/unity-camera-fov-fit
Automatically adjust cameras' FOV to 3D objects bounds in Unity
https://github.com/gilzoide/unity-camera-fov-fit
camera field-of-view fov unity unity2d unity3d upm upm-package
Last synced: 3 months ago
JSON representation
Automatically adjust cameras' FOV to 3D objects bounds in Unity
- Host: GitHub
- URL: https://github.com/gilzoide/unity-camera-fov-fit
- Owner: gilzoide
- License: unlicense
- Created: 2024-04-30T03:13:37.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-08-11T15:37:04.000Z (5 months ago)
- Last Synced: 2024-09-27T23:23:53.457Z (3 months ago)
- Topics: camera, field-of-view, fov, unity, unity2d, unity3d, upm, upm-package
- Language: C#
- Homepage:
- Size: 23.4 KB
- Stars: 23
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Camera FOV Fit
[![openupm](https://img.shields.io/npm/v/com.gilzoide.camera-fov-fit?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.gilzoide.camera-fov-fit/)Automatically adjust cameras' Field Of View (FOV) to 3D objects's bounds in Unity.
## Features
- FOV fitter scripts automatically adjust a camera's FOV to fit the object's bounds.
Only the FOV is adjusted, so that it's transform is maintained.
- Supports both Perspective and Orthogonal cameras.
- [BoundsFovFitter](Runtime/BoundsFovFitter.cs): fits the target camera's FOV to the specified bounds.
- [ColliderFovFitter](Runtime/ColliderFovFitter.cs): fits the target camera's FOV to the specified collider's bounds.
- [RendererFovFitter](Runtime/RendererFovFitter.cs): fits the target camera's FOV to the specified renderer's bounds.
- Configuration for adjusting the FOV automatically in Start, every frame in Update, or none: just call `RefreshFov` manually whenever necessary.
- [Camera.FitFovToBounds](Runtime/FovFitMath.cs) extension method for fitting a camera's FOV to the specified bounds without using the provided components.## How to install
Either:
- Use the [openupm registry](https://openupm.com/) and install this package using the [openupm-cli](https://github.com/openupm/openupm-cli):
```
openupm add com.gilzoide.camera-fov-fit
```
- Install using the [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui-giturl.html) with the following URL:
```
https://github.com/gilzoide/unity-camera-fov-fit.git#1.0.0
```
- Clone this repository or download a snapshot of it directly inside your project's `Assets` or `Packages` folder.