Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / UVW Template like in 3ds Max

Author
Message
Daryn Alsup
18
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 8th Jun 2010 08:55
Anyone who's used 3D Studio Max may have had to render a UVW map to create custom textures for their objects. How would I generate a UVW template in DBPro for a DBPro object?

How does one convert an object UVW data into an image? What theories do you have on how this can be done? I'll be honest and say I have no IDEA how this could be done but I'd like to try - so if anyone has any tips or tricks or anything that could help, please tell me. I'm not looking for straight up code - I'd like to figure this one out myself. Just some tips or general understanding of a method or theories on how it can be done.



-Daryn

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Jun 2010 09:55
There are 2 options really, the neatest one would be to step through each vertex and grab it's UV data, then for each polygon you have the 3 sets of UV coordinates. You could lock the vertexdata for each limb, then quite easily convert the UV's to 2D texture coordinates and display them. I would display over a scaled sprite with the texture, paste the sprite, then draw lines for the UV coords.

Another option, which is less neat, but probably more robust is to convert the whole object to a mesh, then into a memblock. Once it's a memblock, you can scan it and get at the UV coordinates and do the same as with vertexdata.

It might be worth looking into ways of filling 2D polygons quickly, as well as the vertexdata and memblock stuff - it's all worth knowing, especially if this is the sort of stuff you want to be doing. It's possible to do some remarkable things with vertexdata and memblocks.


Health, Ammo, and bacon and eggs!
Math89
22
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 8th Jun 2010 14:00
Why not simply create a mesh having the uv coords as vertex positions?
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Jun 2010 14:48
Quote: "How does one convert an object UVW data into an image?"


I'm guessing he wants to be able to edit, or at least view the data - and creating a mesh with the UV data is a good idea, but a bit fiddly if all you want to do is adjust some coords. Having it as pure 2D would make it easier to manage I think. Considering things like edit points - in 2D they are incredibly easy to do, have little red boxes to drag about in 2D in no time - but in 3D that problem becomes a bit more complex.


Health, Ammo, and bacon and eggs!
Daryn Alsup
18
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 8th Jun 2010 16:34
Well actually I am creating - hell I'll explain.

Say I've created a city-sim game


Now say I have an editor for this game in which you can create custom transportation networks. now say I've gathered the UV data.

I create a plane and place it so that it is roughly the width of the screen and texture it with the uv data. Using Planes and by manipulating different vertices, I place planes with other images on them (selectable images) to define what the texture for the network piece should look like. I get the image and apply it to the custom network and tada...

Just an example that is off the top of my head... but that's what I'm going for.

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.

Login to post a reply

Server time is: 2026-07-25 16:20:19
Your offset time is: 2026-07-25 16:20:19