I'm no good with MIPS assembly at all and wouldn't even know where to start, so I'm hoping someone else here who's more versed in it can help me out...
Basically, I'm trying to get actors to render properly in a viewer, including ex. their limbs' connecting vertices being positioned correctly, if applicable. I know that actors that do have such smooth connections between their limbs, like most human(oid) actors, achieve this by translating/rotating certain vertices of one limb according to the translation/rotation of another limb. They get the other limb's modelview matrix from RAM segment 0x0D via a Mtx (0xDA) command near the start of their display list, then load the connecting vertices (thus positioning them using that matrix), then get their own matrix to finally position and render the rest of the vertices like normal.
Now, after much trial and error I've succeeded in correctly rendering the cow...
...but only the cow. Everything else is more nightmare fuel than actor...
I (most likely!) correctly create OpenTK-side matrices from each limb's/animation's translation and rotation values, relationships between childs, parents and siblings included, and I can create valid "N64-format" matrix data - there's not a single glitch with the cow, as far as I can see. I partially emulate the gSPMatrix / 0xDA Mtx command (not the projection stuff, not needed here; works for the cow and ex. Jabu-Jabu's wobbly walls, albeit rendering them stationary of course), I correctly transform the position of each vertex loaded according to the current modelview matrix (bless OpenTK's Vector3d.Transform). There's two big problems I'm seeing or anticipating:
Problem 1: At what address in segment 0x0D does each limb's matrix have to be stored? I'm currently writing each limb's matrix data into the segment successively, so that limb #1's is at 0x0, limb #2's at 0x40, limb #3's at 0x80, and so on. That's working fine for the cow, but for none of the other actors I've tried so far, like Sheik, Stalfos, Saria, young Zelda, Wallmaster and a few others.
Problem 2: I'm currently relying solely on the Mtx commands to try and position each limb correctly, however some actors don't appear to have any inside their display lists, like the Stalfos. How does the game render those? Or rather, how does the game know to render those differently from actors that do contain Mtx commands?
Well, by this point I'm stumped. I imagine I'd find some more answers if I look into the actors' or the game's code, but as mentioned above, I'm no good with MIPS at all. So I reluctantly have to ask: Has anyone else looked into any of this before, and has something to share about how this all works?
Question
xdaniel
I'm no good with MIPS assembly at all and wouldn't even know where to start, so I'm hoping someone else here who's more versed in it can help me out...
Basically, I'm trying to get actors to render properly in a viewer, including ex. their limbs' connecting vertices being positioned correctly, if applicable. I know that actors that do have such smooth connections between their limbs, like most human(oid) actors, achieve this by translating/rotating certain vertices of one limb according to the translation/rotation of another limb. They get the other limb's modelview matrix from RAM segment 0x0D via a Mtx (0xDA) command near the start of their display list, then load the connecting vertices (thus positioning them using that matrix), then get their own matrix to finally position and render the rest of the vertices like normal.
Now, after much trial and error I've succeeded in correctly rendering the cow...
...but only the cow. Everything else is more nightmare fuel than actor...
I (most likely!) correctly create OpenTK-side matrices from each limb's/animation's translation and rotation values, relationships between childs, parents and siblings included, and I can create valid "N64-format" matrix data - there's not a single glitch with the cow, as far as I can see. I partially emulate the gSPMatrix / 0xDA Mtx command (not the projection stuff, not needed here; works for the cow and ex. Jabu-Jabu's wobbly walls, albeit rendering them stationary of course), I correctly transform the position of each vertex loaded according to the current modelview matrix (bless OpenTK's Vector3d.Transform). There's two big problems I'm seeing or anticipating:
Problem 1: At what address in segment 0x0D does each limb's matrix have to be stored? I'm currently writing each limb's matrix data into the segment successively, so that limb #1's is at 0x0, limb #2's at 0x40, limb #3's at 0x80, and so on. That's working fine for the cow, but for none of the other actors I've tried so far, like Sheik, Stalfos, Saria, young Zelda, Wallmaster and a few others.
Problem 2: I'm currently relying solely on the Mtx commands to try and position each limb correctly, however some actors don't appear to have any inside their display lists, like the Stalfos. How does the game render those? Or rather, how does the game know to render those differently from actors that do contain Mtx commands?
Well, by this point I'm stumped. I imagine I'd find some more answers if I look into the actors' or the game's code, but as mentioned above, I'm no good with MIPS at all. So I reluctantly have to ask: Has anyone else looked into any of this before, and has something to share about how this all works?
Link to comment
Share on other sites
26 answers to this question
Recommended Posts