From 3ecd4938767e9fab5a80861fc755dd303da7cfb3 Mon Sep 17 00:00:00 2001 From: Ian C Date: Wed, 27 Apr 2005 00:04:48 +0000 Subject: Document updates and fixed use of in OpenGL --- docs/msGLExport.txt | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 213 insertions(+), 1 deletion(-) (limited to 'docs/msGLExport.txt') diff --git a/docs/msGLExport.txt b/docs/msGLExport.txt index f3cb54b..8eff565 100644 --- a/docs/msGLExport.txt +++ b/docs/msGLExport.txt @@ -1 +1,213 @@ -!! TODO !! + Milkshape Simple OpenGL Exporter + -------------------------------- + +This exporter outputs simple OpenGL as either C-source or BlitzMax compatible +source. + +To use select 'Simple OpenGL' from the 'Export' menu. When activated a dialog +is displayed with the following items: + + +Info + + A text box with some basic info on the model and what will be created. + + +Directory + + The directory that the sources will be generated in. Use the button + with the 3 periods to the left to select the directory. + + +Class/Function name + + The name of the generated function or class. + + +Use Textures + + Outputs the required 2D texture commands. + + +Generate Info + + Defines some macros or constants that define info on the model, + such as its size, largest co-ordinates and centre of gravity. + + +Force COG to 0,0,0 + + The centre of gravity of the model is defined as the mid-point between + the most distance vertices. If you select this then the co-ordinates + are adjusted so that the model is centered on 0,0,0. + + +Generate for BlitzMax + + If selected generates source for use with BlitzMax, otherwise C sources + are generated. See the following sections describing what's generated + for each language type. + + +Generate for lit scenes + + If selected then the appropriate Open GL commands are output setting + the ambient, diffuse, specular and emissive colours. + + If not selected, then the vertexes are given a simple colour taken + from the materials diffuse colour (or white if no material is + defined). + + + +--------------------------------------------------------------------------- +C Usage +--------------------------------------------------------------------------- + +To use the C source in your project, assuming you gave the function name as +Test, simply include Test.c and #include "Test.h" to use the model. The +function either has the prototype: + +void Test(GLfloat x, GLfloat y, GLfloat z, + GLfloat rot_x, GLfloat rot_y, GLfloat rot_z) + +or if 'Use Textures' was selected: + +void Test(GLfloat x, GLfloat y, GLfloat z, + GLfloat rot_x, GLfloat rot_y, GLfloat rot_z, + GLint texture_id); + + +Simply call it with a position and rotation (and texture ID if needed) to draw +the model. Obviously the function can be called as many times as required +during scene generation. + +Also generated is this function: + +int Test2_CreateList(void); + +If this is called then a OpenGL display list for the model is created (the +function returns FALSE if the list couldn't be created). The Test() function +will automatically use this list once it's created. + + +If 'Generate Info' was selected, then the following macros are defined: + + +TEST_COG_X +TEST_COG_Y +TEST_COG_Z + + Defines the COG of the model (always zeros if 'Force COG ...' was + selected). + + +TEST_MIN_X +TEST_MAX_X +TEST_MIN_Y +TEST_MAX_Y +TEST_MIN_Z +TEST_MAX_Z + + The maximum and minimum vertex values for each axis. + + +TEST_SIZE_X +TEST_SIZE_Y +TEST_SIZE_Z + + The size of the model along each axis. + + +TEST_TEXTURED + + Set to one if 'Use Textures' was selected. Otherwise zero. + + +TEST_MATERIALS + + + Set to one if 'Generate for lit scenes' was selected. Otherwise zero. + + + +--------------------------------------------------------------------------- +BlitzMAX Usage +--------------------------------------------------------------------------- + +To use the source in your project, assuming you gave the function name as +Test, simply include "Test.bmx" to use the model. This defines a class called +Test, which has the following fields: + + +Field x:Float +Field y:Float +Field z:Float +Field rot_x:Float +Field rot_y:Float +Field rot_z:Float + + These defines the position and orientation of each instance. + + +Function Create:Test() + + Used to create an instance. + + +Method Render() *OR* +Method Render(texture_id:Int) + + Renders the model (with the supplied texture if 'Use Textures' was + selected). + + +Function CreateDisplayList:Int() + + Creates a common OpenGL display list used by all instances of the + class. Returns True if the list was created, otherwise False. + + Note that Render() will use the display list automatically if it's + been created. + + +If 'Generate Info' was selected, then the following constants are defined: + +Const COG_X:Float +Const COG_Y:Float +Const COG_Z:Float + + Defines the COG of the model (always zeros if 'Force COG ...' was + selected). + + +Const MIN_X:Float +Const MAX_X:Float +Const MIN_Y:Float +Const MAX_Y:Float +Const MIN_Z:Float +Const MAX_Z:Float + + The maximum and minimum vertex values for each axis. + + +Const SIZE_X:Float +Const SIZE_Y:Float +Const SIZE_Z:Float + + The size of the model along each axis. + + +Const TEXTURED:Int + + Set to True if 'Use Textures' was selected. Otherwise False. + + +Const MATERIALS:Int + + + Set to True if 'Generate for lit scenes' was selected. Otherwise False. + + +------------------------------------------------------------------------------- +$Id$ -- cgit v1.2.3