Skip to content
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

Open
scottrick opened this issue Mar 25, 2023 · 8 comments
Open

Question About Ship Shapes #3

scottrick opened this issue Mar 25, 2023 · 8 comments

Comments

@scottrick
Copy link

Hi,

In Ship.cs, the type Shape has a byte for it's type:

/// /* 0x00 */ byte Type

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!

@MikeG621
Copy link
Owner

MikeG621 commented Mar 25, 2023 via email

@scottrick
Copy link
Author

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!

@MikeG621
Copy link
Owner

MikeG621 commented Mar 28, 2023 via email

@scottrick
Copy link
Author

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.

For example:
image

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

@MikeG621
Copy link
Owner

MikeG621 commented Mar 29, 2023 via email

@rob-pilkington
Copy link

1st bit: indicates if 1-sided (0) or 2-sided (1)
2nd bit: indicates if it should be flat shaded (0) or Gouraud shaded (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.

@scottrick
Copy link
Author

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!

MikeG621 added a commit that referenced this issue Apr 1, 2023
@MikeG621
Copy link
Owner

MikeG621 commented Apr 1, 2023

Added the flags for the Type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants