InvertCamera

From Unify Community Wiki
Revision as of 00:10, 20 October 2011 by Musmeci (Talk | contribs)

Jump to: navigation, search

Author: (Joachim Ante)

Description

This script inverts the view of the camera. So everything rendered by the camera is flipped. This will help you to implement a rear mirror camera.

Usage

Attach the script to a camera.

JavaScript - InvertCamera.js

<javascript> // EXAMPLE WITH CAMERA UPSIDEDOWN function OnPreCull () { camera.ResetWorldToCameraMatrix (); camera.ResetProjectionMatrix (); camera.projectionMatrix = camera.projectionMatrix * Matrix4x4.Scale(Vector3 (1, -1, 1)); }

function OnPreRender () { GL.SetRevertBackfacing (true); }

function OnPostRender () { GL.SetRevertBackfacing (false); }

@script RequireComponent (Camera) </javascript>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox