EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Tools (https://www.eqemulator.org/forums/forumdisplay.php?f=623)
-   -   0x36 fragments for mobs (https://www.eqemulator.org/forums/showthread.php?t=15187)

sandy 08-06-2004 07:01 AM

0x36 fragments for mobs
 
help =)
I don't understand how to read a 0x36 fragment to render a piece of a mob model

the skeleton tree, the piece index, the piececount, the number of vertices per piece ... all this is ok
but how do i get the polygons and textures for each piece ? that's what i don't understand ? =(

Windcatcher 08-06-2004 04:19 PM

First you should look at the source to DZoneConverter (you can get it in the same download area as OpenZone). It does a proper job of loading many (though not all) mob models.

Rendering mob models always starts with an 0x14 fragment. You can follow that to a 0x10 fragment which contains the skeletal structure of the model. That will eventually link to 0x12 and 0x36 fragments. The 0x36 fragment contains the raw vertex and poly information but before rendering you have to use the information in the 0x12 fragments to figure out how each skeletal piece is oriented.

You see, the 0x10 fragment contains a list of references to 0x13 fragmens, where each 0x13 fragment corresponds to exactly one piece of the skeleton. Each 0x13 fragment refers to exactly one 0x12 fragment. In the 0x10 fragment, each of the entries in its list points to one or more entries, such that the skeleton is actually a hierarchical tree. It generally starts with the central torso and branches out recursively until it ends at the extremities. DZoneConverter renders them by recursively following the skeleton piece references in the 0x10 fragment.

For each piece you go from the 0x10 list entry to the corresponding 0x13 and then to the 0x12 fragment. Each 0x12 fragment describes how that skeletal piece (e.g. a forearm) is positioned and oriented relative to its parent piece (e.g. a forearm's parent would be the bicep -- the bicep's parent would be the chest). Positional and orientational information is *cumulative* (so if you move or rotate the bicep, all skeletal pieces that descend from it, like the forearm and hand, move and rotate as well). In the end, the information in the 0x12 fragments amount to three-dimensional transformations that have to be applied to the raw vertex data in the 0x36 fragment before rendering the model.

There are a number of ways to do the actual render. One way, for instance, is to copy all the raw vertices and then walk the skeleton, adjusting all vertices in each skeletal piece as you encounter it. Then, once you've gone through the entire skeleton, render the model with the new vertex data instead of the raw data in the 0x36 fragment. That's only one way to do it and is just a simple example. I don't remember how DZoneConverter does it off the top of my head but you should give it a look.

WC

sandy 08-07-2004 03:18 AM

then to render the meshes, for each polygon, we have to look for which piece countains each vertex to apply the corresponding translations and rotations ?
right ?

Windcatcher 08-08-2004 04:04 AM

That's correct. As you encounter each piece, use the Data6 area of the 0x36 fragment to change only those vertex values for that piece.

WC


All times are GMT -4. The time now is 04:22 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.