Skip to content

Lightweight and simple off-axis camera package for Unity

Notifications You must be signed in to change notification settings

cfazilleau/OffAxisCamera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This project is a unity package for a simple and lightweight OffAxisCamera, based on this excellent article from Michel de Brisis and the paper "Generalized Perspective Projection" by Robert Kooima

Compatible with all render pipelines.

Features

This package allows for simple and fast creation of cameras with off-axis projection, to modify the camera perspective.

image

You only have to add this component to your camera, then set a plane size and camera position. All those properties are accessible at runtime, and the code is commented and accessible.

The custom tool also allows to edit the projection plane size and camera POV position.

Installation

  • In unity 2019+, go to Package Manager (Window/Package Manager).
  • Click the "+" button, then choose "Add package from git URL..."
  • Add "https://github.com/cfazilleau/OffAxisCamera" to the text field and press enter or click "Add".

Properties

The accessible Properties of the OffAxisCamera component are the following:

/// Camera attached to this component, available after Awake().
public Camera Camera;

/// Size of the projection plane.
public Vector2 PlaneSize

/// Point of view plane rect in local coordinates, centered on the camera position.
/// Setting this will add the new rect center value to the camera position.
public Rect PlaneRect

/// Clamp near plane of the attached camera to the projection plane.
public bool UseProjectionAsNearPlane

/// Point Of View of the camera in world coordinates.
public Vector3 PointOfView

/// Point Of View of the camera in local coordinates.
public Vector3 PointOfViewLocal

Unity_Iu72yjMcnZ

About

Lightweight and simple off-axis camera package for Unity

Topics

Resources

Stars

Watchers

Forks

Languages