gothickit / phoenix-studio Goto Github PK
View Code? Open in Web Editor NEWA set of tools for inspecting and converting Gothic and Gothic II game files
License: MIT License
A set of tools for inspecting and converting Gothic and Gothic II game files
License: MIT License
Hi,
I'm not sure if you are aware of this, but in Gothic .zen file for some reason the vertices in world mesh are stored in a funny order, that is: Z, Y, X. Therefore, when you dump world mesh inso .obj file you must consider that when writing v ... ... ...
line to the file.
So here:
phoenix-studio/src/cli/zmodel/main.cc
Line 83 in 584e170
out << "v " << item.z << " " << item.y << " " << item.x << "\n";
,The world mesh .obj file rendered currently:
as you can see the world looks as if seen in a mirror - things that should be on the left side are on the right. Moreover, both the normal vectors (the vn ... ...
lines in .obj) and texture coordinates (the vt ... ...
lines) seem to be defined with the above assumptions regarding the vertice orders. Hence, you can notice some strange artifacts when rendering, like objects being seen through, objects being lit on the bottom even though I set a source of directional sun light from above the scene, etc.
Here is how the .obj file is rendered after making the change in the source code:
looks correct.
Cheers :)
Originally mentioned by @auronen in the GMC Discord (also see auronen/DecDat#2).
Original
func void B_SetNpcVisual (var C_NPC slf, var int gender, var string headMesh, var int faceTex, var int bodyTex, var int armorInstance)
{
slf.aivar[AIV_Gender] = gender;
Mdl_SetVisual (slf,"HUMANS.MDS");
if (gender == MALE)
{
Mdl_SetVisualBody (slf, "hum_body_Naked0", bodyTex, 0, headMesh, faceTex, 0, armorInstance);
if (slf.attribute[ATR_STRENGTH] < 50)
{
Mdl_SetModelScale (slf, 0.9, 1, 1); //BREITE / Höhe / Tiefe
};
if (slf.attribute[ATR_STRENGTH] > 100)
{
Mdl_SetModelScale (slf, 1.1, 1, 1); //BREITE / Höhe / Tiefe
};
}
else //gender == FEMALE
{
if (bodyTex >= 0) && (bodyTex <= 3) //MännerBodyTex angegeben
{
bodyTex = bodyTex + 4; // Females haben Variation 4-7 (Males 0-3)
};
Mdl_SetVisualBody (slf, "Hum_Body_Babe0", bodyTex, 0, headMesh, faceTex, 0, armorInstance);
};
};
Decompiled
func void B_SETNPCVISUAL(var C_NPC SLF, var int GENDER, var string HEADMESH, var int FACETEX, var int BODYTEX, var int ARMORINSTANCE) {
SLF.AIVAR[17] = GENDER;
MDL_SETVISUAL(SLF, "HUMANS.MDS");
if ((GENDER) == (MALE)) {
MDL_SETVISUALBODY(SLF, "hum_body_Naked0", BODYTEX, 0, HEADMESH, FACETEX, 0, ARMORINSTANCE);
if ((SLF.ATTRIBUTE[4]) < (50)) {
MDL_SETMODELSCALE(SLF, 1063675494, 1065353216, 1065353216);
};
if ((SLF.ATTRIBUTE[4]) > (100)) {
MDL_SETMODELSCALE(SLF, 1066192077, 1065353216, 1065353216);
};
};
// -----------------------------------------------------
if (((BODYTEX) >= (0)) && ((BODYTEX) <= (3))) {
BODYTEX = (BODYTEX) + (4);
};
MDL_SETVISUALBODY(SLF, "Hum_Body_Babe0", BODYTEX, 0, HEADMESH, FACETEX, 0, ARMORINSTANCE);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.