Documentation ¶
Index ¶
- Variables
- func ConfigView(wn eve.Node, vn gi3d.Node3D, sc *gi3d.Scene)
- func DepthImage(img *image.RGBA, depth []float32, cmap *giv.ColorMap, cam *Camera)
- func DepthNorm(nd *[]float32, depth []float32, cam *Camera, flipY bool)
- func InitLibSolid(bod eve.Body, sc *gi3d.Scene)
- func InitLibrary(wn eve.Node, sc *gi3d.Scene)
- func SyncNode(wn eve.Node, vn gi3d.Node3D, sc *gi3d.Scene) bool
- func UpdatePose(wn eve.Node, vn gi3d.Node3D)
- type Camera
- type View
Constants ¶
This section is empty.
Variables ¶
var KiT_View = kit.Types.AddType(&View{}, nil)
Functions ¶
func ConfigView ¶
ConfigView configures the view node to properly display world node
func DepthImage ¶
DepthImage renders an image of linear depth map from GPU (0-1 normalized floats) to given image, which must be of appropriate size for map, using given colormap name. Camera params determine whether log is used, and max cutoff distance for sensitive range of distances -- also has Near / Far required to transform numbers into linearized distance values. Y axis is always flipped.
func DepthNorm ¶
DepthNorm renders a normalized linear depth map from GPU (0-1 normalized floats) to given float slice, which is resized if not already appropriate size. if flipY then Y axis is flipped -- input is bottom-Y = 0. Camera params determine whether log is used, and max cutoff distance for sensitive range of distances -- also has Near / Far required to transform numbers into linearized distance values.
func InitLibSolid ¶
InitLibSolid initializes Scene library with Solid for given body
func InitLibrary ¶
InitLibrary initializes Scene library with basic Solid shapes based on bodies in the virtual world. More complex visualizations can be configured after this.
Types ¶
type Camera ¶
type Camera struct { Size image.Point `desc:"size of image to record"` FOV float32 `desc:"field of view in degrees"` Near float32 `def:"0.01" desc:"near plane z coordinate"` Far float32 `def:"1000" desc:"far plane z coordinate"` MaxD float32 `` /* 173-byte string literal not displayed */ LogD bool `def:"true" desc:"use the natural log of 1 + depth for normalized depth values in display etc"` MSample int `def:"4" desc:"number of multi-samples to use for antialising -- 4 is best and default"` UpDir mat32.Vec3 `desc:"up direction for camera -- which way is up -- defaults to positive Y axis, and is reset by call to LookAt method"` }
Camera defines the properties of a camera needed for offscreen rendering
type View ¶
type View struct { World *eve.Group `desc:"the root Group node of the virtual world"` Scene *gi3d.Scene `desc:"the scene object for visualizing"` Root *gi3d.Group `desc:"the root Group node in the Scene where the world is rendered under"` }
View connects a Virtual World with a Gi3D Scene to visualize the world, including ability to render offscreen
func (*View) InitLibrary ¶
func (vw *View) InitLibrary()
InitLibrary initializes Scene library with basic Solid shapes based on bodies in the virtual world. More complex visualizations can be configured after this.
func (*View) RenderOffNode ¶
RenderOffNode does an offscreen render using given node for the camera position and orientation, and given parameters for field-of-view (in degrees, e.g., 30) near plane (.01 default) and far plane (1000 default). and multisampling number (4 = default for good antialiasing, 0 if not hardware accelerated). Current scene camera is saved and restored
func (*View) UpdatePose ¶
func (vw *View) UpdatePose()
UpdatePose updates the view pose values only from world tree. Essential that both trees are already synchronized.