Skip to content

Render line grid on 2D and 3D FTC fields#527

Open
blaze-developer wants to merge 10 commits into
Mechanical-Advantage:mainfrom
blaze-developer:ftcgrid
Open

Render line grid on 2D and 3D FTC fields#527
blaze-developer wants to merge 10 commits into
Mechanical-Advantage:mainfrom
blaze-developer:ftcgrid

Conversation

@blaze-developer
Copy link
Copy Markdown
Contributor

@blaze-developer blaze-developer commented May 19, 2026

Solution for #524

This will draw lines directly onto the 2d field when it is an FTC field. Assuming a 6x6 grid, scaled to the size of the field, and enabled or disabled in per-field configuration.

image image

@j5155
Copy link
Copy Markdown
Contributor

j5155 commented May 20, 2026

There is actually one offseason FTC event per year with a differently scaled field. Last year I made a custom assets file for this from the official field render with the lines built in, so as long as this overlay can be disabled from an asset file setting it's totally fine.

That looks perfect for all the regular fields though! It's okay if it isn't perfectly accurate.

@blaze-developer
Copy link
Copy Markdown
Contributor Author

Does this event have a different number of squares, or no grid at all? Should there be support for specifying dimensions?

@blaze-developer
Copy link
Copy Markdown
Contributor Author

The assets may have to be edited to have more accurate edge lines?

After reviewing with the game manual, the asset edge lines are where they should be, and the grid does extend beneath the walls. Its just an inconsistency with the image in that path-planning software which connects very cleanly to a grid, and from the model of the field that was rendered. So the assets are fine. :)

@j5155
Copy link
Copy Markdown
Contributor

j5155 commented May 21, 2026

I was referring to the Chicago Robotics Invitational, which is a premier event where the field is expanded to be 3v3 instead of 2v2. The exact aspect ratio and size change year to year but it is always still based on the tiles. Last year I just used their field image with the detailed lines for the 2d field, instead of making a render.
Field3d_2025CRIField.zip
Field2d_2025CRIField.zip

The target audience for this would be really small though, since only 38 teams go, so if it's difficult to support don't worry about it.

Are you planning on including 3D field support in this PR as well?

@blaze-developer
Copy link
Copy Markdown
Contributor Author

Are you planning on including 3D field support in this PR as well?

I can certainly give it a shot!

@blaze-developer
Copy link
Copy Markdown
Contributor Author

blaze-developer commented May 21, 2026

How does this look? Should they be any darker? Or are they okay being subtle.

image

@j5155
Copy link
Copy Markdown
Contributor

j5155 commented May 21, 2026

I think the subtle look is great! The center one could match it as well.

@blaze-developer
Copy link
Copy Markdown
Contributor Author

👀

image image image

@blaze-developer blaze-developer marked this pull request as draft May 21, 2026 04:10
@blaze-developer blaze-developer marked this pull request as ready for review May 21, 2026 04:10
@blaze-developer blaze-developer changed the title Render line grid on FTC fields Render line grid on 2D and 3D FTC fields May 21, 2026
@blaze-developer
Copy link
Copy Markdown
Contributor Author

I this this is pretty complete now. Let me know if anything should change :)

@j5155
Copy link
Copy Markdown
Contributor

j5155 commented May 21, 2026

That looks great to me! Your implementation seems perfect as well. Have you tested XR mode?

@blaze-developer
Copy link
Copy Markdown
Contributor Author

blaze-developer commented May 21, 2026

Have you tested XR mode?

I haven't looked enough into it. Is the rendering code done on the iOS device or is the rendering streamed? Does the app need to be updated on the device?

I'm much more familiar with the Android ecosystem for development, and I only have access to an old iPad for testing anything Apple-based. Would jailbreaking be required?

Maybe there should be a section added to the contributing document explaining the testing mechanisms / structure for XR.

@j5155
Copy link
Copy Markdown
Contributor

j5155 commented May 21, 2026

The rendering is done in Typescript code sent to the iOS device when it connects. Look at XRRenderer.ts for the details, but it should be easy to update and you won't need to change the iOS app at all. (Which is good, since it's pretty impossible to develop the iOS app unless you're Jonah lmao)

@blaze-developer
Copy link
Copy Markdown
Contributor Author

Go ahead and give that a try if you'd like. I'll be able to test it when I get home though.

@blaze-developer
Copy link
Copy Markdown
Contributor Author

After some testing, the lines render just fine. But the lines were covered in the 2024/2025 model, because it seems like the XRRenderer never respects the 1.3 centimeter offset applied to that model.

"position": [0, 0, -0.013],

@blaze-developer
Copy link
Copy Markdown
Contributor Author

Aside from that independent issue, XR works now! :)

@j5155
Copy link
Copy Markdown
Contributor

j5155 commented May 21, 2026

com oculus browser-20260521-143605 Works great for me with #515 ! The lines look kinda bad in this screenshot but they look great in headset. I verified they were accurate to the tile sizes as well!

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

Successfully merging this pull request may close these issues.

2 participants