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
Question About Ship Shapes #3
Comments
No, I don't know what the top nibble is really doing. You're seeing the
same thing I have, and this value has been around since the legacy X-wing
days. I don't use it for anything, and it doesn't affect the display of
the wireframe.
|
Thanks. Seems like they may be bit flags of some sort, but it's hard to know for sure. I was hoping to pull out the entire mesh, so I could render the craft as they look in game. I haven't seen it in your documentation so far, but do you have any other information about how it creates the mesh data from the point data? Thanks again, this repo has been very helpful! |
The Shape is the face data, and is where it lists the Vertices used for a
given face. There's a line between each pair of vertices. To draw the
wireframe, after scaling and rotating it's a matter of stepping through
each mesh and drawing each of the lines. It's explained in the paragraph
about Crft.Lod.Shape as to how the vertex indexes are defined within
Shape.Data, as it depends on the number of vertices.
I haven't tried to determine texture data yet, though I'd start from the
OPT spec and try to work backwards, unsure how similar it is to the
original CRFT.
|
Ah, got it. I'm curious, when you render the wire frames, are you getting a couple of slight artifacts, with one or two lines being drawn that aren't supposed to be? I probably messed up my logic some where, but it's so close to looking correct I thought I'd ask. If you look closely, you can see that the Tie Fighter has an extra line drawn near the cockpit. It's very close to correct, but not quite right... Also, if you are on Discord, feel free to ping me here: scottrick#3230 |
I haven't noticed, but then again I'm usually looking at a map-level view,
so even if wireframes are turned on for craft that small, little issues
like that won't be detectable. Now, that's not to say that your logic is
wrong, it's entirely possible that the data is really like that and since
it's just a line that it's not textured or noticeable in-game.
|
1st bit: indicates if 1-sided (0) or 2-sided (1) Lines (shapes with 2 vertices) are encoded differently than polygons. The artifact in screenshot above looks like a line being drawn between vertices of what should be the two different lines making up the two laser cannons on the TIE Fighter. |
Thank you, I will investigate my logic further and compare with yours to find where I am off. I actually was reading through your parsing code:a bit earlier today and it's very helpful. Thanks for sharing! |
Added the flags for the Type |
Hi,
In
Ship.cs
, the typeShape
has a byte for it's type:LfdReader/Ship.cs
Line 103 in 08bf398
The top nibble of that byte is the type. Do you have any documentation for what the types represent?
In my testing, I'm seeing that top nibble be 0, 4, 8, or 12.
Thanks!
The text was updated successfully, but these errors were encountered: