Digital Art Zone

 
     
How do I interpretate the exported vertex texture values?
Posted: 07 March 2013 01:18 AM   [ Ignore ]
New Member
Total Posts:  2
Joined  0

Hi all,

I exported a 8 vertex cube with a shader texture to a wavefront Obj format.

The OBJ file contained a vt list of 42 uv pair coordinates.

I’m a newbie to opengl and learning texture mapping.

I’m having problems defining the texture array in openlg.

currently, WIKI, opengl expects uv textures to be mapped to a image type array.

So, what is the uv pair in the vt export section parametizing?
Is the uv normalized range over the x, y, z span of the 3 faces vertexes?
The opengl image map is expecting a height, width and a parameter lile color to be specify in the image map.
How do the vt pairs specify the above?

King

Profile
 
 
Posted: 07 March 2013 02:36 AM   [ Ignore ]   [ # 1 ]
Power Member
Avatar
RankRankRank
Total Posts:  1825
Joined  2004-08-24

HI King Coffee

Welcome smile

I think you’re over thinking this.

It sounds like you’re opening the OBJ in a text editor,.  no need.

First,.. You make a model,. such as a cube,. then you would apply a “preset” UV mapping type to that model, EG: (Box mapping) and select an appropriate “layout” option,...
Or,.
You can define a “custom” UV Mapping type, EG:( define seams and pins manually,. and use Unwrapping)
Once you’ve applied a “UV Mapping type”,. then your 3D program will know “How to” project the 2D texture maps,.. onto the 3D model.

When you make a 3D model,. and you want to apply a texture to that object, then there are two basic ways..

You can create a “Procedural shader”,. which uses colours, and math’s to apply a texture to the object,. (this doesn’t require any UV mapping)

You can also use 2D images (Texture maps) and apply those to the 3D model,. In this case you DO need to specify how the texture map should be applied to the 3D object.,, and that’s done using UV mapping.

The vertex editor has a UV mapping area,. where you can specify and change the mapping type.
You can also apply different layout options from the “operations” tab

When you apply a UVW mapping type to a 3D object,.
The Objects is split “virtually” and then flattened out into a 2D wire-frame (UV Grid area),.
This is then matched with the 2D layout of your “Texture map”.

In a 3D object,,. the vertices are numbered and have values to specify their 3D position,. (X, Y, Z)
In a 2D image,. values are normally represented with X, and Y.

In a 3D program,... (to avoid confusion)  the 2D mapping reference used is UVW (or UV for short),. while the 3D model reference is XYZ

Hope it helps smile

Profile
 
 
Posted: 07 March 2013 06:09 AM   [ Ignore ]   [ # 2 ]
Addict
Avatar
RankRankRankRank
Total Posts:  6469
Joined  2007-12-04
3DAGE - 07 March 2013 02:36 AM

The vertex editor has a UV mapping area,. where you can specify and change the mapping type.
You can also apply different layout options from the “operations” tab
Hope it helps smile

This is found in the modeling room (Vertex Model Room, little white wrench on the room selection upper right interface)
This picture shows where to find UV editing mode.

Image Attachments
Enter-UV-editing.jpg
 Signature 

Dartanbeck @ Daz3d          Check out the Carrara Cafe          ►►►  Carrara Information Manual   ◄◄◄

Profile
 
 
Posted: 07 March 2013 06:44 AM   [ Ignore ]   [ # 3 ]
Member
Rank
Total Posts:  228
Joined  2006-11-17
3DAGE - 07 March 2013 02:36 AM

I think you’re over thinking this.

I think you have not read the post correctly.

The OP appears to be looking for information on the formatting of an openGL file.
Vertex/texture co-ordinates are (in openGL) formatted differently from .obj files. See pic (part of 2 files) for difference between carrara .obj (left)and openGL ccp.(right) of a simple cube.

 

Image Attachments
file.png
Profile
 
 
Posted: 07 March 2013 11:34 AM   [ Ignore ]   [ # 4 ]
Power Member
Avatar
RankRankRank
Total Posts:  1825
Joined  2004-08-24

You’re quite right Steve… My bad,.


Q: What would the purpose of editing these files be,. ?

Curious

Profile
 
 
Posted: 08 March 2013 12:04 AM   [ Ignore ]   [ # 5 ]
New Member
Total Posts:  2
Joined  0

Right Steve.

I exported a 8 vertex cube with a shader texture from Carrara 6 package to a wavefront Obj format.
The OBJ file contained a vt list of 42 vt coordinate pairs.

I’m having problems defining the texture array in Openlg.

Currently, WIKI, Opengl has a graphic API that handles texture data in a way Carrara 5 OBJ file is not format to output. I don’t want to learn custom UV mapping at this time. I know how to read the Carrara waveFront OBJ file v, vn, and f data. Also, the Material file data. I have successfully parsed the obj and mtl files to render a cube with 2 difference material faces. But cannot apply the vt texture array, I’m not familiar enough to know all the ways opengl API input vt textures (if at all) or how to translate the vt array to a imagemap. Opengl nornal expects to read a texture map and overlay a color pexel ( Its inputing a image).

So, my problem is translating the Carrara vt array in to something opengl understands. The first reply message is discussing advanced Carrara UV processing. Nevertheless, I appreciate it and will review it for future consideration. But it misses the intend of the original questions. Right now, I only want is to output a Carrara OBJ with a standard library texure and then read it in to opengl for simple rendering.
 
My main concern is: the opengl texture uses a 2D image map… and expecting a height, width and a pixel parameter like color (an image) to be mapped to a specify texCoord location.

The problem is the Carrara vt values are a 1D array with an arbitrary length of x,y values.

However, this may really be a WaveFront file question… But, importing vt data details for it is hard to find.

Profile
 
 
Posted: 20 March 2013 11:05 PM   [ Ignore ]   [ # 6 ]
New Member
Total Posts:  2
Joined  0

Hey Steve,

I think I had a misconception of what the vt array represented. I thought it was a rough image sampling of the Shader texture I added to the cube (like a brick or wood texturing), but that’s array is too small.

I’m confused, why no shader file link was meantioned. So, now the question is: how do I export the shader overlay image and align the vt array to that image?

Or is this still a misconception too? The purpose of exporting a 3d object is to able to import the third party work in to another app.

King

Profile