Sign in to follow this  
Wavesonics

LWO (Lightwave) discontinuous UV map loading

Recommended Posts

Wavesonics    330
So I keep coming back to this, I need to be able to load discontinuous UV maps from a .lwo file. I'm using lwobject provided in the LWSDK. But since this is not a plug in, I don't have access to lwMeshInfo. (Or do I? These are all assumptions to some extent, so please correct me if I'm wrong) I was reading: GameDev.net[forum]: LWO loading and UVs And I get the general idea, and I'm down to the last issue which is this: In my in memory format I'm converting to, I have Polygons, which contain PolygonVertex which contains a reference to a Point as well as local UV data. So I shouldn't need to do the Vertex duplicating I see most of the code examples because each Polygon already has a PolygonVertex with it's own UV storage. So I'm at sort of the last part here, which is finding the correct UV coordinate for discontinuous VMaps. In the code from that other thread they seem to be using pntVPIDGet() which is part of lwMeshInfo to get the proper coordinates, but as I said before, I don't think I can use since this isn't a LW plug-in) So how do I locate the proper UV Coordinates inside this struct:
/* vertex maps */

typedef struct st_lwVMap {
   struct st_lwVMap *next, *prev;
   char          *name;
   unsigned int   type;
   int            dim;
   int            nverts;
   int            perpoly;
   int           *vindex;              /* array of point indexes */
   int           *pindex;              /* array of polygon indexes */
   float        **val; // These are the actual UV coordinates, but how do I know which ones go with which polygon points?
} lwVMap;

// Only polygon points with Continuous UV maps have these right?
typedef struct st_lwVMapPt {
   lwVMap        *vmap;
   int            index;               /* vindex or pindex element */
} lwVMapPt;

Share this post


Link to post
Share on other sites
Wavesonics    330
Really what I'm looking for I suppose is what the implementation of:

pntVPIDGet() and pntVIDGet()

look like in lwMeshInfo, but I can't find the source for lwMeshInfo anywhere, only the declarations.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this