render.RenderView

From GMod Wiki

Jump to: navigation, search
Function
Syntax render.RenderView( camera data Cam Data )
Where is this used?
Description:
Renders a view to the current render target.
Returns: Number
Part of Library: render
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Render.RenderView]Render.RenderView [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionMakes a sort of radar over the player, looking down.
Used onNewerClient.png
Code
 
local function OriginCam()
	local CamData = {}
	CamData.angles = Angle(90,LocalPlayer():EyeAngles().yaw,0)
	CamData.origin = LocalPlayer():GetPos()+Vector(0,0,500)
	CamData.x = 0
	CamData.y = 0
	CamData.w = ScrW() / 3
	CamData.h = ScrH() / 3
	render.RenderView( CamData )
end
hook.Add("HUDPaint", "OriginCam", OriginCam)
 
OutputN/A


View Parameters (Camera data)

Structure
Name Camera Data
Available On: NewerClient.png
Description:
Passed to functions that renders the view.

Members

Type Name Description
Vector origin The place where the view should be rendered from.
Angle angles The direction the view should be rendered in.
Number x The x Coordinate of the rendered view on the current render target
Number y The y Coordinate of the rendered view on the current render target
Number w The width of the rendered view on the current render target
Number h The height of the rendered view on the current render target
Boolean drawhud Should the hud be drawn on the view?
Boolean drawviewmodel Should the player's viewmodel be drawn on the view?
Float viewmodelfov What viewmodel FOV should be used to draw it?
Float fov What fov to draw the view with
Boolean ortho If true, will enable Orthographic projection (the same as setting the fov to zero)
Number ortholeft Unknown (Added Nov 2009 Update)
Number orthoright Unknown (Added Nov 2009 Update)
Number orthotop Unknown (Added Nov 2009 Update)
Number orthobottom Unknown (Added Nov 2009 Update)
Float znear Near clipping distance
Float zfar Far clipping distance
Float znearviewmodel Near clipping distance for view model
Float zfarviewmodel Far clipping distance for view model
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox