Author Topic: Vertex issues with FF7 16 bit signed ints?  (Read 2924 times)

Cyberman

  • *
  • Posts: 1572
    • View Profile
Vertex issues with FF7 16 bit signed ints?
« on: 2006-03-13 19:39:36 »
Hmmm I don't remember having this problem before but some of the models vertexs are huge and producing rather anoying results.

Example 1 <ENEMY000> looks fine, it has only one object in the data.

Example 2 <ENEMY059> looks oddly mutant.. really :D

Example 3 <TIFA> is OK but not OK :D


The only thing I can think of I am misaligning the data I'm reading however, why does it work so nicely for a single boned object?  The vertex values get inexplicably huge for some reason.

Cyb

sfx1999

  • *
  • Posts: 1142
    • View Profile
Vertex issues with FF7 16 bit signed ints?
« Reply #1 on: 2006-03-13 22:25:23 »
I am guessing it is an endian problem. Also, did you accidentally convert from signed to unsigned?

mirex

  • *
  • Posts: 1645
    • View Profile
    • http://mirex.mypage.sk
Vertex issues with FF7 16 bit signed ints?
« Reply #2 on: 2006-03-14 12:26:08 »
my guess is
- you're overwriting memory
- you calculate wrong offset when moving to next bone
- you calculate wrong vertex indexes

interesting is that colours look correct (on tifa), just the vertex positions / or polygon - vertex indexes are messed up.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Vertex issues with FF7 16 bit signed ints?
« Reply #3 on: 2006-03-14 18:25:01 »
Hmmm I think that the vertex list is getting messed with, perhaps I should convert the vertex list for each bone (prior to potential corruption I guess :D).
I'm using the actual vertex indices.  It seems that something is messing with the vertex count somewhere in my software as well.

FF7 stores indices into the vertex list that are 16 bit offsets.
So triangle[0] might have verttices 1 2 and 3 but there offsets would be 8 16 and 24
In one model I have 64 vertices in a bone however an index of 62 hits garbage numbers (U is not 0 when it should be). So it seems somethings amiss like you say. hmmm

I wonder if I can find this by using pointers to type const in the vertex array and see where the exception is thrown :D

Cyb