Jump to content
  • Advertisement
Sign in to follow this  
Wavesonics

LWO (Lightwave) discontinuous UV map loading

This topic is 3625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!