.\"
.\" Copyright (c) 2006-2011 Hypertriton, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd June 23, 2006
.Dt SG 3
.Os
.ds vT FreeSG API Reference
.ds oS FreeSG 1.0
.Sh NAME
.Nm SG
.Nd FreeSG 3D scene graph
.Sh SYNOPSIS
.Bd -literal
#include
#include
.Ed
.Sh DESCRIPTION
The
.Nm
object is a general-purpose scene-graph, or a collection of nodes (i.e.,
.Xr SG_Node 3
objects) organized in a tree structure.
The
.Ft SG_Node
object is used to describe both "group" nodes and "leaf" nodes.
.Pp
Scene-graphs are usually rendered using the
.Xr SG_View 3
widget (or a subclass of it).
.Sh INHERITANCE HIERARCHY
.Xr AG_Object 3 ->
.Nm .
.Sh INITIALIZATION
.nr nS 1
.Ft "SG *"
.Fn SG_New "void *parent" "const char *name" "Uint flags"
.Pp
.nr nS 0
The
.Fn SG_New
function allocates, initializes, and attaches a
.Nm
object.
Acceptable
.Fa flags
options include:
.Pp
.Bl -tag -width "SG_SKIP_UNKNOWN_NODES "
.It SG_OVERLAY_WIREFRAME
Overlay wireframe onto geometric objects when rendering scene.
.It SG_OVERLAY_VERTICES
Overlay vertices onto geometric objects when rendering scene.
.It SG_OVERLAY_VNORMALS
Overlay vertex normals when rendering scene.
.It SG_OVERLAY_FNORMALS
Overlay facet normals when rendering scene.
.It 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).
.El
.Sh EXAMPLES
See
.Pa demos/sgview
in the FreeSG source distribution.
.Sh SEE ALSO
.Xr SG_Intro 3 ,
.Xr M_Plane 3 ,
.Xr M_Real 3 ,
.Xr M_Matrix 3 ,
.Xr M_Vector 3
.Sh HISTORY
The
.Nm
object first appeared in FreeSG 1.0.