Convex3D.class.php

Short support for convex 3dclass.php.

Package contents:
- Convex3d.class.php - p3d 3D viewer class
- Object.class.php - Internal 3D models holder class
- Gifmerge.class.php - Simple animated GIF builder (optional)
- View.php - example file for Convex3d.class
- Example.html - this file
- /models/*.p3d - external models

Class Constructor

$convex3d = new Convex3D(string obj, string type, array bgcolor, array objcolor, int width, int height);

string obj:
Object name.
For external objects give filename with full path e.g.: 'models/cube.p3d'
For internal objects give the name as:

cube

int
1
cuboctahedron

int 2
dodecahedron

int 3
icosahedron

int 4
icosidodecahedron

int 5
icosidodecahedron_2

int 6
octahedron

int 7
rhombicosidodecahedron

int 8
rhombicuboctahedron

int 9
snub_cuboctahedron

int 10
tetrahedron

int 11
truncated_cube

int 12
truncated_cuboctahedron

int 13
truncated_dodecahedron

int 14
truncated_icosahedron

int 15
truncated_icosidodecahedron

int 16
truncated_octahedron

int 17
truncated_tetrahedron

int 18

string type:
Object source type wich may INT for the internal source or EXT for the external 'file' source.

array bgcolor:
The image background color, array type e.g.: array(r=>255, g=>255, b=>255)

array objcolor:
The object color, array type e.g.:
array(r=>255, g=>0, b=>0)

int width, int height:
The image dimensions.

Object Initalize

This function can be used to initalize and prepare the object.
Typical syntax is $convex3d->rotate(int rotX, int rotY);
int rotX and int rotY parameters will be set the axis of the object, default values are 0.
For animation can be used to rotate object with these parameters such as:
<?php
for($i = 0; $i < 360; $i++)
{
    $convex3d->rotate(0, 17); // For 360 degrees horizontal  rotate
    $convex3d->rotate(17, 0); // For 360 degrees vertical rotate
    $convex3d->rotate(17, 17); // For 360 degrees horizontal and vertical rotate
    imageGif($convex3d->object());
}
?>
The rotX and rotY are constant integers for still image and animation too.

Image retrieve

This function can be used to retrieve the image.
Typical syntax is 
imageGif($convex3d->object());


more support on http://gifs.hu