How do I interpretate the exported vertex texture values?

King CoffeeKing Coffee Posts: 0
edited December 1969 in Carrara Discussion

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

Comments

  • 3DAGE3DAGE Posts: 3,311
    edited December 1969

    HI King Coffee

    Welcome :)

    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 :)

  • DartanbeckDartanbeck Posts: 21,574
    edited December 1969

    3DAGE said:

    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 :)

    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.
    Enter-UV-editing.jpg
    1680 x 945 - 334K
  • stem_athomestem_athome Posts: 518
    edited March 2013

    3DAGE said:
    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.

    file.png
    658 x 708 - 35K
    Post edited by stem_athome on
  • 3DAGE3DAGE Posts: 3,311
    edited December 1969

    You're quite right Steve... My bad,.


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

    Curious

  • King CoffeeKing Coffee Posts: 0
    edited March 2013

    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.

    Post edited by King Coffee on
  • King CoffeeKing Coffee Posts: 0
    edited March 2013

    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

    Post edited by King Coffee on
Sign In or Register to comment.