News:

 

Topic: Obj Export - Texture vertices  (Read 11741 times)

0 Members and 2 Guests are viewing this topic.

  • Posts: 424
  • Triangle
    • Reiner`s Tilesets
September 21, 2012, 11:00:17 am
Nvil exports three coordinates per texture vertice. Usually it`s just two though. U and V. Even when it`s called UVW, heh. Texture space is planar 2D space. The third number is not needed here. It`s always zero:

Quote
# texture coords

vt 1 0.333333 0.0
vt 0 0.333333 0.0
vt 0.25 0 0.0
vt 1 0.666667 0.0

I am also not sure if it`s a good idea to shorten the numbers. Which are usually six digits behind the dot. I seem to remember that there`s a possible trouble point with that. But can`t remember what it was. So i can also be wrong here. On the other hand, this makes smaller files. I will keep an eye at it :)
Free Gamegraphics, Freeware Games http//www.reinerstilesets.de

  • No avatar
  • Posts: 3760
  • Developer
  • Administrator
  • Polygon
September 22, 2012, 08:21:36 am
W is removed.

I am also not sure if it`s a good idea to shorten the numbers. Which are usually six digits behind the dot. I seem to remember that there`s a possible trouble point with that. But can`t remember what it was. So i can also be wrong here. On the other hand, this makes smaller files. I will keep an eye at it :)

I don't think it's a good idea. You may loose precision, especially when models are very small.

  • Posts: 546
  • Administrator
  • Polygon
September 22, 2012, 12:13:31 pm
I think it should be left alone, since the W has a use in rare cases, and other 3d packages can exit it. Also it is part of the obj spec

  • Posts: 424
  • Triangle
    • Reiner`s Tilesets
September 22, 2012, 12:41:36 pm
Even when it´s part of the specification, W isn`t written by any obj exporter that i know. I also don`t know any use inside of Nvil for W. So it`s save to remove it. And you benefit by smaller file size.

Quote
I don't think it's a good idea. You may loose precision, especially when models are very small.

That`s a misunderstanding i guess. I was complaining that the numbers in the by Nvil written obj file are cut off. They show 1 or 1.0 instead 1.000000. As told i remember some trouble with such shortened numbers in connection with Obj. On the other hand, i had a look at the Obj from Blender, and it cuts off the numbers in an equal way. So simply forget this issue. I can`t remember what the trouble was anyways.
Free Gamegraphics, Freeware Games http//www.reinerstilesets.de

  • Posts: 546
  • Administrator
  • Polygon
September 22, 2012, 03:10:51 pm
well what i meant is some apps use it like max, and will save it out, and it should be there so the data can stay intact while models are imported and exported between different apps and nvil.
what could be done is just have a "if else" statement controller if if all w coords = 0 it doesn't print it.

i persnally got no use for W but i have seen it used before, for procedural textures, and some volometric effects

yes the precision thing is not a issue if there is nothing after the decimal such as 1.0, but yes if there are decimals it should go no farther than 6 places.