Modifying the model matrix??

I’ve been playing with some large-scale planet rendering concepts, and I’ve encountered this:

http://www.gamasutra.com/view/feature/2984/a_realtime_procedural_universe_.php

Specifically this:

“I solved both of these problems by scaling down the size and the distance of planetary bodies by modifying the model matrix. Using a defined constant for the desired far clipping plane, which I’ll call FCP for now, I exponentially scale down the distance so that everything past FCP/2 (out to infinity) is scaled down to fall between FCP/2 and FCP.”

I understand that conceptually, but is it possible to scale the model matrix’s distance in Unity? Would I just scale my planet mesh down along the camera’s look axis?

In Unity the Transform component covers the functionality of the ModelMatrix (also called world matrix). The model matrix is just a “TSR” matrix (Translation, Scaling, Rotation). It corresponds with the Transforms localPosition, localScale and localRotation. Unity can build a matrix from those 3 seperate vectors.

You can access the matrix with the localToWorldMatrix property of a transform component. However you usually just use the localScale to change the scale.