[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

5033.0. "3D is Xspec-tacular" by MR4DEC::GAY (Underground living can be Hobbit forming) Tue Sep 10 1991 12:33

    Are there any other X-Specs users out there?  
    
    I've just brought the public domain library xspecs.lzh over usenet
    from ab20 and made the minor mods to its example and glue files so 
    they work with SAS (Lattice) C.  
    
    The example is neat, the library looks reasonably easy to use.  I
    am looking forwardward to rolling it into the stuff I am writing.
    
    Would anyone else be interested in the library and/or is anyone
    else already using it?  I'll upload it if there's interest and
    I'd like to share info with anyone else who is using it.
    
    Eben
T.RTitleUserPersonal
Name
DateLines
5033.1ELWOOD::PETERSTue Sep 10 1991 14:436
    
    
    	I'm interested in X-Specs ...
    
    		Steve P.
    
5033.2X-Spec? 3D graphics routines??SNOC01::JACOBMARKUsque Ad Mortem AddendumWed Sep 11 1991 00:279
    
    If you could give a brief description of what kind of stuff is in the
    library, I might be. Is it a graphics routines library? I also use SAS
    (Lattice) C and am always interested in libraries that take the "leg
    work" out of writing my stuff.
    
    Regards, Mark.
    
    
5033.3I like themSALEM::LEIMBERGERWed Sep 11 1991 05:446
    I just read a blurb somewhere that said Haitex is back with X-specs TV.
    (oct AW pg.8) .I have had X-Specs for a long time now but haven't done
    much with them. I'd like to see new life introduced to this product. As
    an aside did SV make it into Imagine. I have seen no reference to it in
    my manuals.
    								bill
5033.4Waiting for lemon soaked paper napkins..MR4DEC::GAYUnderground living can be Hobbit formingThu Sep 12 1991 14:2827
    My 2000 decided to emulate a doorstop.  I'll upload the stuff when
    it is running again.
    
    (figgers, I had four active projects - all most of the way to the
    next milestone when I would have backed them up...
    At least I do back things up fairly often so I won't have THAT many
    days worth of work to re-do if the disk got mangled.)
    
    The XSpecs are liquid crystal glasses that plug into the 2nd joystick
    port.  Software can toggle the lines on the joystick port to darken
    the glass in one eye or the other.  The theory is that the program
    alternates views for the left and right eyes while darkening the 
    glasses for the right and left eyes.  The Amiga hardware makes this
    "easy" (a slightly over-used word).  To make "easy" a bit easier,
    Richard Horne wrote a library that hides all the hard stuff and 
    accepts draw and sprite calls with x,y,z coordinates.  Robert A.
    Schader added a layer in front that makes it callable by Manx C
    and put it on ab20 (with one example but no documentation).  I 
    modified Robert's code to make it callable from SAS (Lattice) C 
    and created some rough documentation for the calls (based on the 
    example, the include files, some playing, and some guessing).  
    I'll upload the result when I get my system running again (or when
    I re-create it, depending on the state of my hard disk...)
    
    Yrs
    Erg
    
5033.5XSpecs library, glue, example uploadedMR4DEC::GAYUnderground living can be Hobbit formingThu Sep 19 1991 11:27155
    I uploaded xspecs.lzh (Robert's archive) and xspecssas.lzh (the files I
    modifed for SAS C) to EOT::Amiga:[upload].
    
    This is the list of routines in the library (from the readme file in 
    xspecssas.lzh). 
    

Robert's archive did not include documentation for the xspecs library.  
The following is the list of routine declarations given in the xspecs.h 
include file.  The names are pretty obvious if you have been programming
the Amiga much.  I have included the return codes given in xspecs.h.

The argument descriptions are my best guesses after reading the example and 
playing a bit.  As with any guess, no warantee for correctness is stated 
or implied :-)  Some of the routines I have not used, but guessed at anyway.  
I marked these routines with an @ sign 'cause you are taking my word for 
it @ your own risk.

LONG XSpecsAllocateView __ARGS( (long) );
   arg: appears to be the modes bits for the ViewPort structure
        (defined in <graphics/view.h>).  The example defines it as
        0xC000 which would be the flags HIRES and SPRITES)
   returns: 
        XCANTALLOCVIEW    /* Can't allocate two Views and related items */
        XIMPROPERVIEWMODE /* Improper View Modes Specified in call */
        XVIEWALLOCATED    /* Success! */

VOID  XSpecsDeallocateView();

struct MsgPort *XSpecsOn __ARGS( (long) );
   Starts the Xspecs flickering.
   arg: appears to be the IDCMP flags to use with the window.
   returns:
        The message port to receive windows events on OR
        XNOUSERPORT     /* Function was unsucccessful */
    
VOID  XSpecsOff();
   Stops the Xspecs.

VOID  XSpecsSetAPen __ARGS( (ULONG) );
   Set pen to use for drawing, writing
   arg: pen number

@ VOID  XSpecsSetRGB4 __ARGS( (ULONG, ULONG, ULONG, ULONG) );
   Set color of given pen
   arg1: pen number (0..31)
   arg2: red intensity (0..15)
   arg3: green intensity (0..15)
   arg4: blue intensity (0..15)

VOID  XSpecsLoadRGB4 __ARGS( (APTR, ULONG) );
   Load color table into color registers
   arg1: pointer to color table array
   arg2: number of words in array

LONG XSpecsText __ARGS( (APTR, LONG, LONG, LONG, ULONG) );
   Draw the given text string
   arg1: pointer to text string
   arg2,3,4: x,y,z coordinate to place string at
   arg5: number of bytes in string
   returns:
        COORGOOD        /* Success! */
        COOROUTERLIMITS /* Attempted to move outside of screen limits */

@ LONG XSpecsWritePixel __ARGS( (LONG, LONG, LONG ) );
   Write a pixel
   arg1,2,3: x,y,z coordinates
   returns:
        COORGOOD        /* Success! */
        COOROUTERLIMITS /* Attempted to move outside of screen limits */

LONG XSpecsDraw __ARGS( (LONG, LONG, LONG) );
   arg1,2,3: x,y,z coordinate to draw to
   returns:
        COORGOOD        /* Success! */
        COOROUTERLIMITS /* Attempted to move outside of screen limits */

LONG XSpecsChangeSprite __ARGS( (APTR, ULONG) );
   arg1: pointer to sprite image (in chip memory)
   arg2: sprite number
   returns:
        XSPRITECHANGED  /* Success! */
        XNOSPRITENUM    /* Have to call XSpecsGetSprite() first */

LONG XSpecsMoveSprite __ARGS( (LONG, LONG, LONG, LONG, LONG, ULONG) );
   arg1,2,3: x,y,z
   arg4,5: ?
   arg6: sprite number
   returns:
        COORGOOD        /* Success! */
        COOROUTERLIMITS /* Attempted to move outside of screen limits */

@ LONG  XSpecsLeftXY __ARGS( (LONG, LONG, LONG) );
   I guess that this returns the x,y screen coord for the left eye image of 
   a given x,y,z 3D location.
   arg1,2,3: x,y,z
   returns:
        XPOINTOUTERLIMITS /* Point is Outside of screen limits */
/* Need to also create a define which will extract the x and y value from */
/* the value returned from these functions. x = bits 31-16 and y = 15-0 */

@ LONG  XSpecsRightXY __ARGS( (LONG, LONG, LONG) );
   I guess that this returns the x,y screen coord for the right eye image of 
   a given x,y,z 3D location.
   arg1,2,3: x,y,z
   returns:
        same as XSpecsLeftXY

@ struct RastPort *XSpecsLeftRastPort();
   guess: get rast port for left eye image
   
@ struct RastPort *XSpecsRightRastPort();
   guess: get rast port for right eye image

@ struct ViewPort *XSpecsLeftViewPort();
   guess: get viewport for left eye image

@ struct ViewPort *XSpecsRightViewPort();
   guess: get viewport for right eye image

@ VOID  XSpecsSetDrMd __ARGS( (ULONG) );
   Set drawing mode
   arg1: draw mode (JAM1, JAM2, ..|INVERSVID)

LONG XSpecsPolyDraw __ARGS( (APTR, ULONG) );
   Draw a set of connected lines
   arg1: pointer to array of x,y,z coords
   arg2: number of points in array (number of x,y,z coord triples)
   returns:
        COORGOOD        /* Success! */
        COOROUTERLIMITS /* Attempted to move outside of screen limits */

LONG XSpecsMove __ARGS( (LONG, LONG, LONG) );
   Move to x,y,z
   arg1,2,3: x,y,z
   returns:
        COORGOOD        /* Success! */
        COOROUTERLIMITS /* Attempted to move outside of screen limits */

LONG XSpecsGetSprite __ARGS( (APTR, APTR, ULONG) );
   Get a sprite
   arg1: pointer to SimpleSprite structure
   arg2: pointer to sprite image in chip memory
   arg3: sprite number
   Returns:
        XNOSPRITEASS    /* Unable to assign the sprite */

VOID  XSpecsFreeSprite __ARGS( (ULONG) );
   arg: sprite number

LONG  XSpecsTime();
   Returns absolute time value of some sort.  I bet it increments every
   time an eye is exposed, so waiting for it to increment by at least two 
   (which is what the demo does) guarantees that both left and right eyes have
   seen the data.