[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

B.3 JSON format

MathGL can save points and primitives of 3D object. It contain a set of variables listed below.

width

width of the image;

height

height of the image

depth

depth of the image, usually =sqrt(width*height);

npnts

number of points (vertexes);

pnts

array of coordinates of points (vertexes), each element is array in form [x, y, z];

nprim

number of primitives;

prim

array of primitives, each element is array in form [type, n1, n2, n3, n4, id, s, w, p, z, color].

Here type is kind of primitive (0 - mark, 1 - line, 2 - triangle, 3 - quadrangle, 4 - glyph), n1...n4 is index of point for vertexes and n2 can be index of glyph coordinate, s and w are size and width if applicable, z is average z-coordinate, id is primitive identification number, p is scaling factor for glyphs.

ncoor

number of glyph positions

coor

array of glyph positions, each element is array in form [dx,dy]

nglfs

number of glyph descriptions

glfs

array of glyph descriptions, each element is array in form [nT, nL, [xA0, yA0, xB0, yB0, xC0, yC0, xA1, yA1, xB1, yB1, xC1, yC1 ...], [xP0, yP0, xP1, yP1 ...]]. Here nT is the number of triangles; nL is the number of line vertexes; xA, yA, xB, yB, xC, yC are coordinates of triangles; and xP, yP, xQ, yQ are coordinates of lines. Line coordinate xP=0x3fff, yP=0x3fff denote line breaking.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated on August 12, 2013 using texi2html 1.82.