InvertCamera

From Unify Community Wiki
Revision as of 19:06, 19 October 2009 by NCarter (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.

Usage

Attach the script to a camera.

JavaScript - InvertCamera.js

<javascript> 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