GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SG(3) FreeBSD Library Functions Manual SG(3)

SGAgar-SG 3D scene graph

#include <agar/core.h>
#include <agar/sg.h>

The SG object is a general-purpose scene-graph, or a collection of nodes (i.e., SG_Node(3) objects) organized in a tree structure. The SG_Node object is used to describe both "group" nodes and "leaf" nodes.

Scene-graphs are usually rendered using the SG_View(3) widget (or a subclass of it).

AG_Object(3) -> SG.

SG *
(void *parent, const char *name, Uint flags);


void
(SG *sg);

The () function allocates, initializes, and attaches a SG object. Acceptable flags options include:

SG_OVERLAY_WIREFRAME
Overlay wireframe onto geometric objects when rendering scene.
SG_OVERLAY_VERTICES
Overlay vertices onto geometric objects when rendering scene.
SG_OVERLAY_VNORMALS
Overlay vertex normals when rendering scene.
SG_OVERLAY_FNORMALS
Overlay facet normals when rendering scene.
SG_SKIP_UNKNOWN_NODES
When loading the contents of a scene, ignore unknown/unimplemented elements (otherwise, encountering an unknown node will make the load operation fail).
SG_NO_DEFAULT_NODES
Don't create the default nodes (e.g., ‘Camera0’, ‘Light0’).

The () routine reinitializes sg to an empty scene. If default nodes (e.g., ‘Camera0’) are used, they are preserved but their state is reinitialized.

SG_Node *
SG_SearchNodes(SG_Node *parent, const char *name);


void *
(SG *sg, const char *name);


int
(SG_Node *node, M_Geom3 g, M_GeomSet3 *S);

The () function scans all descendants of parent for a node of the specified name. The SG_FindNode() function searches the entire scene graph sg for a node of the specified name. On success, SG_SearchNodes() and SG_FindNode() return a pointer to the matching node.

The () function performs an intersection test between the given node and an arbitrary geometrical object g (see M_Geom3(3)). The function returns 1 if the objects intersect, 0 if they don't intersect, or -1 if the test is not implemented. If the S argument is non-NULL, the intersections are computed and returned as one or more geometrical objects, into S. The structure pointed to by S should have been previously initialized with M_GEOM_SET_EMPTY(3).

sgedit(1), M_Matrix(3), M_Plane(3), M_Real(3), M_Vector(3), SG_Intro(3)

The SG library first appeared in Agar 1.6.0.

December 21, 2022 Agar 1.7

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.