Author Topic: Load normals from file  (Read 4208 times)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Load normals from file
« Reply #15 on: June 24, 2012, 04:26:38 pm »
Any news about normals?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Load normals from file
« Reply #16 on: June 24, 2012, 07:53:21 pm »
No, not yet...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Load normals from file
« Reply #17 on: July 02, 2012, 08:42:16 pm »
Give it a try:

http://jpct.de/download/beta/jpct.jar
http://jpct.de/download/beta/jpct_ae.jar

Both have a new switch in Config (Config.useNormalsFromOBJ). Setting this to true will make jPCT load the normals from the file and don't calculate new ones during build(). At least that's what's supposed to happen.... ;)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Load normals from file
« Reply #18 on: July 03, 2012, 02:05:25 pm »
I created test project, so you can see how it works (back button for load/calculate normals, menu button for switch between many objects). Any idea why is lighting bad??

http://dl.dropbox.com/u/26148874/TestProject.zip

edit: in 3ds max and deep exploration seems these models correctly...
« Last Edit: July 03, 2012, 02:07:28 pm by Thomas. »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Load normals from file
« Reply #19 on: July 03, 2012, 02:23:28 pm »
Can't run that ATM. Any screen shots?

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Load normals from file
« Reply #20 on: July 03, 2012, 02:35:05 pm »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Load normals from file
« Reply #21 on: July 03, 2012, 09:42:40 pm »
I found the problem. Whoever invented the OBJ-format has to suffer endlessly...i'll try to fix it, but it will require some internal changes to the object compiler as well...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Load normals from file
« Reply #22 on: July 03, 2012, 10:13:03 pm »
I've uploaded new versions that might work better. However, this comes at the cost of additional compile time (might not be significant, i haven't benchmarked this) and slightly higher memory usage of objects with "file normals".

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Load normals from file
« Reply #23 on: July 03, 2012, 10:24:52 pm »
YES, nice, everything seems fine :)

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Load normals from file
« Reply #24 on: July 04, 2012, 02:51:24 am »
Quote
Whoever invented the OBJ-format has to suffer endlessly

Well the closest names responsible I could come up with is the founders of Wavefront.  :P
Quote
It was founded in 1984, in Santa Barbara, California, by Bill Kovacs, Larry Barels, Mark Sylvester.
http://en.wikipedia.org/wiki/Wavefront_Technologies