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

topic: SVG rendering #19

Open
shritesh opened this issue Mar 9, 2024 · 11 comments
Open

topic: SVG rendering #19

shritesh opened this issue Mar 9, 2024 · 11 comments
Assignees
Labels
assigned Topic has been assigned in-content Is the issue in lesson content?
Milestone

Comments

@shritesh
Copy link
Contributor

shritesh commented Mar 9, 2024

IMO the book should showcase a platform implementation and turtle graphics is a fun and simple one to do.

@gvwilson
Copy link
Collaborator

gvwilson commented Mar 10, 2024

Thanks for the proposal @shritesh - the theme of the previous two books was "tools that programmers use when programming", and while I'm a big fan of turtle graphics for teaching, I don't think it's something people use when building code. @rtfeldman thoughts on how wide you want this to go? (Cf. discussion of implementing a neural network in #4.)

@gvwilson gvwilson added discuss An issue or PR currently being discussed in-content Is the issue in lesson content? propose-addition A suggestion for an addition to content or infrastructure labels Mar 10, 2024
@gvwilson gvwilson added this to the topic-outline milestone Mar 10, 2024
@rtfeldman
Copy link
Contributor

Ah that's a fair point! I think turtle graphics in Roc would be really cool to see, but maybe it's not quite the right fit for this particular book.

@gvwilson
Copy link
Collaborator

As an alternative: @shritesh would you be interested in showing people how (a simple subset of) SVG is rendered? Or how to translate https://aosabook.org/en/500L/a-3d-modeller.html into Roc?

@shritesh
Copy link
Contributor Author

shritesh commented Mar 10, 2024

Both of those ideas sound awesome. I have already built a raytracer (based on the Ray Tracing in One Weekend book) in Roc along with a platform for graphics. We can probably extract a lot from there.

@gvwilson
Copy link
Collaborator

Thanks @shritesh - I think a ray tracer has the same issue as turtle graphics, but a graphics platform would be a great fit. If you want to tackle the latter, can you please create a directory under the project root called graphics and put your work there as a standalone Roc project plus an index.md file with your nodes to yourself? And if you can confirm, I'll update this ticket and assign it to you. Cheers - Greg

@Anton-4
Copy link
Collaborator

Anton-4 commented Mar 11, 2024

showing people how (a simple subset of) SVG is rendered?

In case it may still be useful: https://github.com/Hasnep/roc-svg

@shritesh
Copy link
Contributor Author

shritesh commented Mar 11, 2024

I'll go with the SVG rendering. I'll also implement a simple Canvas platform that takes in a framebuffer and renders it. That way, the entirety of the rendering content will be in Roc and the platform itself can be useful for the rest of the ecosystem.

Thanks @Anton-4, that'll definitely be useful.

@shritesh shritesh changed the title topic proposal: turtle graphics topic proposal: svg rendering Mar 11, 2024
@gvwilson gvwilson changed the title topic proposal: svg rendering topic: SVG rendering Mar 11, 2024
@gvwilson gvwilson added assigned Topic has been assigned and removed discuss An issue or PR currently being discussed propose-addition A suggestion for an addition to content or infrastructure labels Mar 11, 2024
@gvwilson
Copy link
Collaborator

Thanks @shritesh - can you please create a PR that creates a subdirectory svg under the project root and put your code there as a standalone Roc project? Please also add an index.md file that has your notes to yourself - cheers.

@shritesh
Copy link
Contributor Author

Will do later tonight! Thanks

@shritesh
Copy link
Contributor Author

I just released a library to create images and export to PNG in pure Roc: https://github.com/shritesh/roc-image. I'll probably use this instead of building a framebuffer platform.

@shritesh
Copy link
Contributor Author

I've added an example in roc-image to render the Roc SVG logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned Topic has been assigned in-content Is the issue in lesson content?
Projects
None yet
Development

No branches or pull requests

4 participants