Donkie / I3DShapesTool

Tool used for extracting the binary .i3d.shapes files used by the GIANTS engine
MIT License
24 stars 10 forks source link

Rename unknown variables and objects #31

Closed thraidh closed 2 years ago

thraidh commented 2 years ago

Source for names is Farming Simulator 22/shared/xml/schema/i3d-1.6.xsd.

Tangent data was compared to tangent data computed by threejs and found identical.

It is still unknown how exactly file data is mapped in I3DShapeAttachment.

Donkie commented 2 years ago

This is wicked, thank you! I will look over this in more detail soon and then merge it 😀

thraidh commented 2 years ago

Always happy to help! I'm still a bit confused by the "Attachments" as the information in the shapes file doesn't really match what is in the xsd file. Attachments only seem to appear on non-rendered shapes. I haven't seen any shape with more than one attachment yet.

Donkie commented 2 years ago

Just a curious question as well, why are tangents described by a 4D vector? I thought they were 3D things.

Donkie commented 2 years ago

Found quite a few shapes with multiple attachments btw in FS22, seems to be all related to map items

shoppingCartShape inside "maps/mapFR/map.i3d.shapes" broom0Shape1 inside "maps/mapUS/map.i3d.shapes" gardenHoseCarrier01Shape inside "maps/mapUS/map.i3d.shapes" bucketRustyShape inside "maps/mapUS/map.i3d.shapes" sportsBagShape inside "maps/mapUS/map.i3d.shapes" gardenHoseCarrier03Shape inside "maps/mapUS/map.i3d.shapes" basketChairShape inside "maps/mapUS/map.i3d.shapes" foldingBeachChairShape inside "maps/mapUS/map.i3d.shapes" transportBarrowShape inside "maps/mapUS/map.i3d.shapes" smlBasketballShape inside "maps/mapUS/map.i3d.shapes"

thraidh commented 2 years ago

Tangents are actually 2 2D vectors, that are used in texture space (I think, but I may be wrong here). In the meantime I found that the number of attachments seems to be always 0 or the number of subsets. They are also calculated automatically. When I tried to add <Attachments> to the i3d file, it always ended up with something completely different. Attachments seem to be calculated when there are no tangents and usually happen on collision shapes.

Donkie commented 2 years ago

Thanks for the help :)

thraidh commented 2 years ago

Always happy to help. Regarding attachments: from what I have seen they represent some kind of bounding volume, but a little bit inset into the actual object. So far I have seen only cuboids with 8 vertices or wedges with 6 which are calculated from the geometry of the actual object. I don't know what they are used for in game. Anyway, this will probably only be necessary to know when you try to convert models from FBX or so into i3d.shapes and even then it might be easier to convert then into i3d XML and use the GIANTS tool in the Blender exporter to convert the XML into a smaller XML and i3d.shapes. The Blender exporter is under GPL, but the way they are using that binary exe does not put it under GPL, otherwise we would have been entitled to the source code...