PositionSpawnIcon
Description
Moves the given model to the given position and calculates appropriate camera parameters for rendering the model to an icon.
The output table interacts nicely with Panel:RebuildSpawnIconEx with a few key renames.
Arguments
Returns
Example
Creates a clientside model and then PositionSpawnIcon is used to figure out the appropriate camera parameters for rendering this model.
local ent = ClientsideModel("models/props_wasteland/cafeteria_table001a.mdl", RENDERGROUP_BOTH)
local tab = PositionSpawnIcon(ent, vector_origin)
ent:Remove()
PrintTable(tab)
Output:
angles = 25.000 220.000 0.000
fov = 8.4436927451273
origin = 1156.924316 970.773010 704.184265
zfar = 1888.5692536466
znear = 1