-
Notifications
You must be signed in to change notification settings - Fork 1
Dumping world mesh into .obj files - inverted X and Z axis #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey! Yes that's a good point :) Do you know whether that applies to normals too? |
I made some additional tests with increased lighting (higher value of specular Current normals look: Swapped axis normals look: So this line also needs modification: phoenix-studio/src/cli/zmodel/main.cc Line 91 in 584e170
Sorry for missleading you before. |
BTW. if the |
Yea I mean that can also be solved by swapping the coordinates in a shader. Anyways, this is how it was intended in the original format so I'll load it as-is I think. |
The original format does not contain names for the values. It is the phoenix who gives names to values, so it should do this properly. Next person who will use phoenix might be confused becouse of this. I figured this out relatively soon since I remember the mirror world effect from one of the discussion over ReGoth project few years ago. But I'm not gonna insist, just sharing my point of view, the decision is yours :) |
I would create a pull request myself, but I'm haveing some issues with github authentication :/ phoenix-studio/src/cli/zmodel/main.cc Line 40 in e075f1b
phoenix-studio/src/cli/zmodel/main.cc Line 50 in e075f1b
|
Uh oh!
There was an error while loading. Please reload this page.
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
it should rather be
out << "v " << item.z << " " << item.y << " " << item.x << "\n";
,but only in case if we are dealing with world mesh. (I think other meshes have the proper order)
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 (thevt ... ...
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 :)
The text was updated successfully, but these errors were encountered: