OpenGL 3D code producing program

Started by
12 comments, last by davior 23 years, 11 months ago
I hope this helps. Here''s how I store my objects:


typedef struct
{
int ver[3]; //vertex
float norm[3]; //flat tri normal (for flat shading)
float pNorm[3][3]; //point normals (for smooth shading)

float texCo[3][2]; //tex coord [point] [x/y]
} obtri_t;


typedef struct
{
unsigned numvers;
unsigned numfaces;

obver_t *ver;
obtri_t *tri;

char texFN[30]; //texture filename
int texNum; //GL texture object
} objectType_t;

typedef struct
{
float rot[3];
float pos[3];
objectType_t *OT;
} object_t;


http://www.geocities.com/ben32768

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

Advertisement
While obviously an idea which needs much refining, I feel that the concept still stands. While producing many lines of code for every object created IS ridiculous, with little thought and tweaking the same concept could produce a single line of code which uses a class or stucture to produce the same results. So essentually, yes, the iniatial idea was ridiculous. But the concept..... Thanks for your inputs. I'll let you know what I come up with, eventually...
davior




Edited by - davior on May 9, 2000 10:51:15 AM
My bet is you''ll come up with a .3ds model file reader in an object class


#pragma DWIM // Do What I Mean!
~ Mad Keith ~
**I use Software Mode**
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
Good luck.

http://www.geocities.com/ben32768

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

This topic is closed to new replies.

Advertisement