need help with a 3d routine!!

need help with a 3d routine!!

Post by Kevin Joine » Fri, 30 Jan 1998 04:00:00



Ok here's the problem. I want to use some 3d routines from Andre
Lamothe's book, Black Art of 3d Game Programming. Unfortunately the code
is for Borland and doesn't want to compile. I am attempting to take some
of the routines and use them with allegro for a project i am working on.

I keep getting this error though:

Error: type specifier omitted for parameter
Error: parse error before '*'

they are referring to this function declaration:

char *PLG_Get_Line(char *string, int max_length, FILE *fp);

i think that the char type might be a typo since in the definition the
return type is int. Anyway, I was wondering if anyone can see something
dumb that I'm trying to do at a glance. Any advice would be appreciated.

thanks


 
 
 

need help with a 3d routine!!

Post by Scott Warn » Mon, 02 Feb 1998 04:00:00


Kevin,

If you're using C++, you might have a problem with a parameter called string.  You'll also have to include <stdio.h> to make sure that FILE is defined.  Hm.  Other than that it looks fine to me.  You might look at the lines preceding this declaration for missing semicolons, etc.

Scott


> Ok here's the problem. I want to use some 3d routines from Andre
> Lamothe's book, Black Art of 3d Game Programming. Unfortunately the code
> is for Borland and doesn't want to compile. I am attempting to take some
> of the routines and use them with allegro for a project i am working on.

> I keep getting this error though:

> Error: type specifier omitted for parameter
> Error: parse error before '*'

> they are referring to this function declaration:

> char *PLG_Get_Line(char *string, int max_length, FILE *fp);

> i think that the char type might be a typo since in the definition the
> return type is int. Anyway, I was wondering if anyone can see something
> dumb that I'm trying to do at a glance. Any advice would be appreciated.

> thanks




 
 
 

1. 3D Routines Needed

              ******** 3D CODE AND INFO NEEDED ********

Hello all...  I do not understand the concepts behind 3D transformations,
although I would like to.  Right now though I need a quick fix.  If you
know how I can get the following specific code, PLEASE TELL ME!  If you
know where I can get a reference that will explain very clearly how to
write the following code, PLEASE TELL ME!  I need the fastest algorithms
known to date.   I am programming with the djgpp port of GCC for protected
mode in DOS, so code written assuming a UNIX GCC ANSI compiler would be
perfect.  If it requires many trig functions and other such calculations
I would prefer that it look them up from a table rather than calculate them.
Memory usage is not an issue - SPEED IS!  If there is a better way to lay
out the data, feel free.  In the finished application, I would like to be
able to drag around the directional vector tip (with viewing coords in tow)
while specifying what is "up" as an angle from the Z axis.  I would like
as much of it as possible to be integer math, of course.  The Transform()
function just takes viewing data and a 3D triangle and spits out the
2D triangle coords...

Data types:

typedef struct {
   double x[3];  /* X coordinates of 3D triangle */
   double y[3];  /* Y... */
   double z[3];  /* Z... */

typedef struct {
   short x[3];  /* X coordinates of 2D triangle */
   short y[3];  /* Y... */

typedef struct {  /* Positive Z is up */
   double x;  /* X coordinate of eye */
   double y;  /* Y... */
   double z;  /* Z... */
   double to_x;  /* Vector tip in viewing direction */
   double to_y;  /* Y... */
   double to_z;  /* Z... */
   double up;  /* Angle offset from Z for "up" (radians) */
   short dist;  /* Pixel distance from eye to screen */
   short width;  /* Screen width */
   short height;  /* Screen height */

Function prototype:

2d Transform(3d panel, loc view);

Please mail any responses!

Thank you!

John Muehlhausen

2. EONS now following forum

3. Oracle Workgroup Server vs. OracleWare ?

4. 3D Graphics routines

5. timer

6. Allegro 3D routines

7. Anyone know a "Close All Apps" app?

8. problems with the 3d matrix routines.

9. Allegro 3D Routines - How fast are they?

10. Allegro 3d routines

11. 3d programming/ray casting - need help

12. help - need to draw a room in 3D