home *** CD-ROM | disk | FTP | other *** search
- -------------------------------------------------------------------
- ! XYZ++ Release 1.1 -- 3D graphics class library
- ! Copyright (C) 1993, Nicholas Centanni All Rights Reserved
- --------------------------------------------- ~October 14, 1993`----
-
-
- -------------------------
- | OVERVIEW
- -------------------------
- The xyz++ class library is a C++ graphics development object
- library developed for users of Borland C/C++ version 3.1. It
- includes functions to handle three-dimensional perspective graphics
- in a fast and efficient manner. With xyz++, adding 3D graphics to
- an application requires surprisingly few lines of code, since the
- bulk of the mathematics is encapsulated neatly into the library
- system.
-
- The 3D Viewer class is fully device-independent, so the system is
- shipped with several additional classes to provide an interface to
- Borland's BGI graphics. The additional major classes are Graphics,
- Mouse, Keyboard, and Panel (a mini-graphical user interface). These
- classes provide the support necessary to create the various example
- programs included with the package. The example programs may be
- used by the developer as a learning tool while becoming familiar
- with the system.
-
-
- -------------------------
- | SOURCE CODE
- -------------------------
- The library source code is included for several reasons:
-
- -- Library source code becomes essential when debugging a program.
- Sometimes it is necessary to trace all the way into a library
- function in order to clearly see what is happening in a specific
- context.
-
- -- It helps to read the source code for a function in order to
- fully understand its purpose.
-
- -- Even when a system is highly generic, there are those times
- when it becomes necessary to make certain changes to library
- functions in order to produce the best possible end product.
-
-
- -------------------------
- | THE VIEWER CLASS
- -------------------------
- The three-dimensional graphics system is added to a program
- by declaring an instance of a class called Viewer. Once you have
- declared this object, you have access to more than 60 member
- functions for: changing the position of a viewer in space,
- changing the angle of view, calculating the positions of object
- vertices, and making general calculations for defining planes,
- vectors, and implementing 3D clipping.
-
-
-
- Output can be directed to any number of independent viewing
- rectangles on screen, which allows for multiple views of your scene
- or true stereoscopic rendering.
-
-
- -------------------------
- | A SIMPLE EXAMPLE
- -------------------------
- To get an idea of how the library functions are used, here is an
- example of the minimal code required to define and plot a single
- point in 3D space:
-
-
- !#include <graphics.h>
- !#include "op_view.h"
- !#include "op_graph.h"
-
- !l_point point = { 20L, 20L, 20L }; |// Define a point in space
- !i_screen pixel; |// Define destination pixel
-
- !Viewer viewer; |// Declare an instance of the Viewer class
- !Graphics graphics; |// Declare an instance of the BGI class
-
- !void main()
- !{
- registerbgidriver(EGAVGA_driver);
- graphics.on(EGA, EGAHI, ""); |// Start graphics
-
- graphics.define_port(0, 0, 0, 640, 350); |// Define PORT
- graphics.set_port(0); |// Change to PORT
-
- viewer.set_position(100, 100, 100); |// Define viewer position
- viewer.set_zoom(15); |// Set viewing angle
- viewer.set_center(20, 20, 20); |// Set center of interest
- viewer.view_center(); |// View center of interest
- viewer.new_view(); |// Prepare for 3D math
- viewer.translate(&point, &pixel); |// Find screen position
-
- putpixel(pixel.x, pixel.y, WHITE); |// Plot the point
-
- graphics.off(); |// Return to text mode
- !}
-
-
-
-
- -------------------------
- | DISTRIBUTION POLICY
- -------------------------
- The xyz++ graphics class library is copyrighted software, and may
- not be duplicated or distributed, with the exception of the
- installation of the software by a licensed user, to additional
- computers to be used exclusively by that licensed user.
-
-
-
- You may distribute any product you develop using the xyz++ class
- library, royalty free. However, under no circumstances may the
- library binaries, or any of the supplied source code be shipped with
- your product, unless a specific arrangement has been made with the
- author to do so.
-
-
- -------------------------
- | PRICING
- -------------------------
- The current revision of xyz++ (1.1), is being offered at this
- time for $35.00.
-
- Licensed users of this release of xyz++ are eligible to receive
- unlimited technical support. Upgrades to the next revision will
- cost $5.00 (to cover diskettes, shipping and handling only).
-
-
- -------------------------
- | CONTACTING THE AUTHOR
- -------------------------
- If you have any further questions about NIGHT BIRD or xyz++, feel
- free to leave a message for the author on Compuserve: [70431,2147],
- Internet: nickc@netcom.com, or voice mail: (408) 236-2264.
-
-
- -------------------------
- | LIBRARY FUNCTIONS
- -------------------------
- The following is a list of all member functions currently
- available in the xyz++ package, with brief descriptions of their
- use.
-
-
- -------------------------
- ! Viewer class
- -------------------------
- set_position Set viewer position
- get_position Get viewer position
- get_x, get_y, get_z Get components of viewer position
- set_center Define the center of interest
- get_cx, get_cy, get_cz Get components of the center of interest
- move_east, move_west Move along the X axis
- move_up, move_down Move along the Y axis
- move_north, move_south Move along the Z axis
- move_forward Move along the current line of sight
- move_left, move_right Move perpendicular to line of sight
- move Calculate movement in a given direction
- orbit Circular movement around scene center
- calc_travel Find components of a movement direction
- calc_distance Find distance between viewer and center
- calc_radius Find radius between viewer and center
- get_distance Get the most recent viewer distance
- clip_angle Inhibit a given angle between 0 and 360
- set_direction Set the current viewing direction
-
-
- view_center View towards the center of interest
- chg_pitch Turn about the X axis
- chg_heading Turn about the Y axis
- chg_bank Turn about the Z axis
- set_zoom Set the current viewing magnification
- zoom_in, zoom_out Increase/decrease viewing magnification
- get_heading Get viewer HEADING
- get_bank Get viewer BANK
- get_pitch Get viewer PITCH
- get_zoom Get the current viewing magnification
- new_view Let system know that view has changed
- cos_sin Read from a FIXED point SIN/COS table
- translate Find new ROTATED/SCREEN coordinates
- rotate Find new ROTATED coordinates
- project Find new SCREEN coordinates
- vector_product Calculate the product of two vectors
- dot_product Calculate the dot product of two vectors
- plane Calculate the coefficients of a plane
- intersect Find intersection of a line and a plane
- clip_point 3D clip POINT against viewing window
- clip_line 3D clip LINE against viewing window
- clip_poly 3D clip POLYGON against viewing window
-
-
- -------------------------
- ! Shading class
- -------------------------
- set_ambient_intensity Set the intensity value for ambient light
- get_ambient_intensity Get the intensity value for ambient light
- set_spot_direction Set the direction of a light source
- set_spot_intensity Set the brightness of a light source
- define_source Create a light source
- set_source Change an existing light source
- set_ambient Set the value of ambient light
- set_reflectance Set the reflectance of a surface
- get_shade Return a shade mapped to a given range
-
-
- -------------------------
- ! Graphics class
- -------------------------
- on Start graphics
- off Return to text mode
- define_port Define a display port
- set_port Set the desired port for current output
- get_port Get the dimensions of the current port
- clear_port Clear the current port with a given color
- border_port Draw a border around a port
- port_ofs Calculate the y_offset for a port
- inner_clip Define an inner clipping region
- set_active Set the active drawing page
- set_visual Set the current visual page
- enable_split_screen Start the SPLIT-VGA 640x480 mode
- reset_pages Clear the animation system
- set_active, set_visual Explicitly set the graphics page
- chg_active_page Toggle the currently active page
-
-
- chg_visual_page Toggle the currently visual page
- set_active_to_visual Set the active page to the visual one
- set_visual_to_active Set the visual page to the active one
- set_active_to_split Set the active page to split page zero
- paging_on Activate the animation paging system
- paging_off Disable the animation paging system
- paging Returns the state of the paging system
- clear_screen Clear the video screen
- wait_retrace Wait for the next vertical retrace
- blank Clear rectangle for text output
- print Graphics equivalent of printf()
- set_txt_background Set the text background color
- prepare_clip_map Prepare to display clipped bitmaps
- draw_bitmap Draw a bitmap with no clipping
- clip_bitmap Draw bitmap with horz & vert clipping
- inset_bevel Draw a beveled rectangle
- fill_convex_polygon Fills a polygon of three or more sides
-
-
- -------------------------
- ! Graphics-Font class
- -------------------------
- set_colors Set the colors for an entire font
- set_spacing Set the current character spacing
- print Display a graphics font string
-
-
- -------------------------
- ! Mouse class
- -------------------------
- activate Enable the mouse
- graphic_cursor Change the mouse cursor shape
- prepare_cursor Prepare for a BGI cursor
- set_hotspot Set the cursor hot spot
- set_method Set the mouse display method
- text_cursor Configure a text mouse
- move_ratio Set mouse behavior
- range Set mouse range
- speed Set mouse speed
- clip Clip mouse to a rectangular area
- install_handler Install a mouse interrupt handler
- read Read the current mouse state
- pressed Has a given mouse button been pressed
- released Has a given mouse button been released
- set_crt_pageno Set the current mouse video page
- get_crt_pageno Get the current mouse video page
- moveto Reposition the mouse cursor
- set_port_no Identify the mouse graphics port
- show Display the mouse cursor
- hide Hide the mouse cursor
- disable_text_cursor Hide the text mouse cursor
- gr_cursor Set the graphics cursor
- bit_cursor Identify the mouse bitmap
- asm_draw Draw cursor with ASM bitmap function
- asm_erase Erase the cursor with the ASM function
- asm_update Update/Draw cursor with ASM function
- bgi_draw Draw cursor with BGI bitmap function
-
-
- bgi_erase Erase the cursor with the BGI function
- bgi_update Update/Draw cursor with BGI function
-
-
- -------------------------
- ! GUI Panel class
- -------------------------
- add_BMPbutton Add a bitmap button to the panel
- add_BGIbutton Add a BGI-drawn button to the panel
- add_led Add a numeric display to the panel
- add_radio Add a radio button
- add_prompt Add a text prompt
- button_up Animate a button in its UP state
- button_down Animate a button in its DOWN state
- button_inactivate Gray-out an inactive button
- draw_default_button Indicate the default button
- default_button Set the default button
- draw_default_group Indicate a default control group
- default_group Set the default control group
- find_default_group Find the current default control group
- draw Draw the current panel controls
- events Wait for a panel event
- get_key Listen for a keystroke
- send_event Manually post a panel event
- clear_key Clear any waiting keystrokes
- define Set up a control panel
- display Display a control panel and background
- key_read Process a keystroke
-
-
- -------------------------
- ! Keyboard class
- -------------------------
- check Check for a new keypress
- read Read a new keystroke
- last Return the last read keystroke
-
-
- -------------------------
- | PACKAGE CONTENTS
- -------------------------
- ! Libraries
- XYZ_6S.LIB - 3D library for 8086 - small model
- XYZ_6L.LIB - 3D library for 8086 - large model
- XYZ_3S.LIB - 3D library for 80386 - small model
- XYZ_3L.LIB - 3D library for 80386 - large model
- BGI_6S.LIB - BGI interface library for 8086 - small model
- BGI_6L.LIB - BGI interface library for 8086 - large model
- BGI_3S.LIB - BGI interface library for 80386 - small model
- BGI_3L.LIB - BGI interface library for 80386 - large model
- MAKE_*.BAT - Set of batch files for building all libraries
-
- ! Examples
- NBIRD.PRJ - Animates a bird in flight
- WATER.PRJ - Simulation of water fountains
- SLOT.PRJ - Simulation of a slot machine
- REALITY.PRJ - A sample virtual reality control panel
-
-
- POINT.PRJ - Plots a single point
- SQUARE.PRJ - Draw a square in 3D perspective
- SQ_MOVE.PRJ - Animate a square using the BGI filler
- W_CUBE.PRJ - Animate a wire-frame cube
- H_CUBE.PRJ - Animate a solid cube with hidden lines removed
- S_CUBE.PRJ - Animate a filled cube using the VGA-SPLIT mode
- PANEL.PRJ - Demonstration of an EGA control panel
-
- ! Documentation
- MANUAL.DOC - Describes usage of all member functions
-
-
-
-