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
Shape converter issues (self-intersecting edges, normals) #8
Comments
@shrizza I think those are two separate issues actually. The inside color of the missile not being correct is related to issues #2, #3, and possibly #9. Issue #2 has the most helpful information on the problem, but the short explanation is that The other contributing problem is the way OpenGL draws polygons that intersect with the camera. As far as I understand it, at least. |
I'm adding this here because the converter is in the process of being merged into our repo's scripts directory instead of its own directory. The missile shape stems from a larger issue during shape conversion for avara--there are self intersecting edges in that shape so the converter has to reorganize the shape to account for new verts added during triangulation to compensate for these self intersecting edges. Beyond that, from doing experiments with lighting, it seems that some of the models (at least including but not limited to the head model) have improper normals causing lighting to be incorrect: This shows the hector head lit from above, where both sides of the main hull shape should be lit in equal amounts. Clearly the normal is flipped here and is giving the lighting value for the wrong side of the shape. |
Updates on this: The self-intersecting shapes are still a problem. The way I have this set up, each polygon of a BSP is flattened into a 2d plane for the Triangle library to operate on, and give a list of triangles to fill out of the edge/vertices. With these self-intersecting shapes, the library adds new vertices to make the shape regular. However, it does this in the 2-space of the flat face and not 3-space of the BSP as a whole, so I can't just add the new vertices to the shape, without converting them back into 3-space. This is proving very difficult to do correctly so that the vertices end up in the right places. What I do currently is take an arbitrary pair of vertices from the face and use that as a vector in the plane of the shape to project all vertices on to a 2d plane. But it seems that the length of that vector has an effect on the scale/position of the resulting projection. I'm gonna try to reach out to some folks to see if there's a better way of making sure that these projections (and their reverse) end up the same every time. |
The normals and stuff look much better now. I haven't seen any graphical bugs with the new converter code. |
multiple levels fixed
see avaraline/avara-level-converter#1 - this is a self intersecting shape
The text was updated successfully, but these errors were encountered: