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_IMAGE(3) FreeBSD Library Functions Manual SG_IMAGE(3)

SG_ImageAgar-SG polygonal 2D image object

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

The SG_Image node maps an input image onto a polygonal mesh. If transparency information is available, SG_Image generates a complex polygon contour for the image.

AG_Object(3) -> SG_Node(3) -> SG_Image.

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


SG_Image *
(SG_Node *parent, const char *name, AG_Surface *s);


SG_Image *
(SG_Node *parent, const char *name, AG_Surface *s);


SG_Image *
(SG_Node *parent, const char *name, const AG_Anim *anim);


SG_Image *
(SG_Node *parent, const char *name, AG_Anim *anim);


void
(SG_Image *bb, const AG_Surface *s, M_Real scale);


void
(SG_Image *bb, AG_Surface *s);


int
(SG_Image *bb, AG_Anim *anim);


int
(SG_Image *bb, AG_Anim *anim);


void
(SG_Image *bb);


void
(SG_Image *bb);


void
(SG_Image *bb, enum sg_image_shape shape);


void
(SG_Image *bb);


void
(SG_Image *bb, int enable);


void
(SG_Image *bb, float tol);


void
(SG_Image *bb, M_Real w, M_Real h);


void
(SG_Image *bb, const AG_Color *c);

The () function creates a new image node at the origin of the parent node. The SG_ImageFromSurface() and SG_ImageFromAnim() variants set an initial surface or animation.

The () function loads the specified surface. Image pixels are related to SG(3) node coordinates by the scaling factor scale.

The () function loads the specified animation (see AG_Anim(3)). Playback can be initiated or stopped with SG_ImageAnimPlay() and SG_ImageAnimStop().

() selects the contour shape for the image object. Possible values for shape include:

SG_IMAGE_RECT
Render as solid rectangle.
SG_IMAGE_POLYGON
Render as a complex polygon calculated from the contours of the image. The contour of the polygon is reduced to a manageable set of vertices using Douglas-Peucker polygon simplification.

The () function scans the image and selects SG_IMAGE_POLYGON if a usable shape exists over a transparent background, otherwise the SG_IMAGE_RECT shape is selected.

() configures the image projection mode. If an argument of 1 is given, the image object will be rendered as to always face the camera. Otherwise, the object is rendered as a textured plane in its original orientation (the default).

() sets the tolerance for Douglas-Peucker simplification (default is 10.0).

() sets the relative size of the image (default is 1.0 x 1.0).

() sets the background color (RGBA) of the image object (default is transparent black).

The following public SG_Image flags are defined:

SG_IMAGE_BILLBOARD
Enable billboard projection (image will be rendered as facing the camera).
SG_IMAGE_WIREFRAME
Overlay the wireframe structure ontop of the image surface. This can be useful when adjusting the contour tolerance.

For the SG_Image object:

Uint flags
Option flags (see “FLAGS” section).
M_Color color
Background color.
AG_Surface *su
Current source surface (read-only; use
M_Real w
Width (default is 1.0).
M_Real h
Height (default is 1.0).
float tolContour
Tolerance for polygon simplification (default is 10.0).

AG_Surface(3), M_Color(3), M_Real(3), M_Vector(3), SG(3), SG_Intro(3), SG_Node(3), SG_Plane(3)

The SG_Image node class 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.