cam.Start3D
From GMod Wiki
Function | |
Syntax |
cam.Start3D( Vector position, Angle angle, Integer fov, Integer x, Integer y, Integer w, Integer , h ) Where is this used? |
Description: | |
Positions the rendering camera three dimensionally. | |
Returns: | nil |
Part of Library: | Cam |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Cam.Start3D]Cam.Start3D [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
FOV, x, y, w and h are optional.
This is not the player's view camera, this is a rendering camera. While it may be possible to affect the player's view with this, that is not its primary purpose.
In the first example given, it should be noted that because Draw functions are 2D rendering and that this is using 3D camera positioning, the rendered box does not have a proper z-index and will always render on top. Face the box and place your held weapon "over" it. You will find that the box is drawn on top of your weapon.
It should also be noted that the position and angle do not seem to update when this is hooked via HUDPaint.
The z-index issue may be solved by using a render target. Needs testing and example.