oceansam / ForcedPerspective

πŸ” Recreating a forced perspective technique

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ForcedPerspective

Recreating a forced perspective technique

Inspiration

I got interested in recreating a similar feature from the game Superliminal. The feature allowed object sizes to change without changing the users perspective of the game object.

Alt Text

I took a simpler approach to this as you will see in the demo gif below.

Summary

Now of course there is a mathematical explaination for this which is commonly known as "Angular Diameter". Alt Text

We can see its dependent on both distance and diameter.

In short, Angular Diameter is a way of describing how an object is viewed at different points of view. In terms of our little demo, to achieve our goal we need to maintain the angular diameter given a change to the distance and size.

In reality, we just need to proportionally scale the size of the object relative to the distance.

Creating a weird perspective change.

The final product can be seen in the gif below.

Alt Text

We can see little to no change in our perspective of the object, however, the size changes drastically.

Controls:

WASD - Movement

Shift - Sprint

E - Pickup

Q - Drop

G - Activates the perspective change

Scripts:

FirstPerson_Controller.cs - Movement and Camera controls

FPC_Bob.cs - First person bobbing movement (Was experimenting)

Pickup_Controller.cs - Interactable pickup controls + angular diameter method.

About

πŸ” Recreating a forced perspective technique


Languages

Language:C# 100.0%