/usr/share/doc/z88dk-doc/lib3d.txt is in z88dk-doc 1.8.ds1-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | -------------------------
3D Libraries (2/15/2002)
Doc taken from the OZ Developement kit.
See section III for Credits on this file and on the whole library
$Id: lib3d.txt,v 1.3 2004/03/02 16:49:48 stefano Exp $
-------------------------
TOC
I. Introduction
II. Reference
III. Credits/Acknowledgements
IV. Links
I. Introduction
----------------
The 3D Libraries include a standard set of functions for making your own 3D functions. This document is a reference for these functions.
II. Reference
--------------
The following is a reference for the available functions in lib3d.lib. Please note that you will have to include "lib3d.h" in order to use these functions in your code.
void ozrotatepointx(Vector_t *v, int rot)
void ozrotatepointy(Vector_t *v, int rot)
void ozrotatepointz(Vector_t *v, int rot)
Use these functions to rotate a vector around the origin. The variable 'rot' is the rotation factor in degrees (?), not radians (? × p ÷ 180). Note: Do not rotate the original coordinates! This will distort an object after a few times of use. Use ozcopyvector() to first copy the coordinates into a temporary variable and rotate them there.
Example:
...
Vector_t v;
...
v.x = 10;
v.y = 10;
v.z = 10;
ozrotatepointx(&v, 90);
ozrotatepointy(&v, 90);
ozrotatepointz(&v, 90);
...
void ozcopyvector(Vector_t *dest, Vector_t *src)
This function copies a vector's X, Y, and Z coordinates from *src to *dest.
Example:
...
Vector_t v1;
Vector_t v2;
...
ozcopyvector(&v2, &v1);
...
void oztranslatevector(Vector_t *v, Vector_t *offset)
Offset a vector by using this function. It will add the X, Y and Z coordinates from *offset to *v.
Example:
...
Vector_t v1;
Vector_t v2;
...
oztranslatevector(&v2, &v1);
...
void ozplotpointcam(Vector_t *v, Cam_t *c, Point_t *p)
This function will convert 3D vectors (X, Y, Z) into 2D Points (X, Y). This will even compensate for camera's position and angle. If you do not wish to use a camera in your program, use ozplotpoint() instead (see next function.)
Example:
...
Vector_t v;
Point_t p;
Cam_t mycam;
...
ozplotpointcam(&v, &mycam, &p);
...
void ozplotpoint(Vector_t *v, Point_t *p)
This function converts 3D vectors to 2D points without compensating for camera's position, thus it is much faster.
Example:
...
Vector_t v;
Point_t p;
...
ozplotpointcam(&v, &p);
...
III. Credits/Acknowledgements
3D Libraries Copyright© 2002, Mark Hamilton Jr. Vector rotation optimizations performed by Lawrence Chitty. Wonderful Sine and Cosine enhancements done by Alexander Pruss.
Many thanks to on-line tutorials, Alexander Pruss and Benjamin Green for helping me with 3D concepts. I certainly learned a lot from this experience.
IV. Links
http://evesw.techmods.com - My development site.
http://www.ozdev.com - You should know this place--it's where you got the Hi-Tech C compiler from!
|