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

Add option to interpolate brush rotation throughout stroke #3

Open
adamwulf opened this issue Sep 19, 2016 · 2 comments
Open

Add option to interpolate brush rotation throughout stroke #3

adamwulf opened this issue Sep 19, 2016 · 2 comments

Comments

@adamwulf
Copy link
Owner

Right now, the brush rotation is static throughout the entire stroke. The brush texture can be rotated only once at the beginning of the stroke, and that rotation is used for the rest of the stroke. This is great for creating highlighter style pens where a rectangle texture can be rotated to the initial direction of the stroke and then kept constant (as is done in Loose Leaf's highlighter), but it would allow for more interesting brushes to also be able to interpolate the rotation throughout the stroke, as is done with color and width.

@ghost
Copy link

ghost commented Apr 12, 2017

any update on this ?

@adamwulf
Copy link
Owner Author

I haven't started work on this one yet, it'd be a great place for someone to jump in and add it. Very old versions of JotUI had interpolated rotation, but used gl_triangles to render instead of gl_points.

Older GL versions couldn't rotate point sprites, so I had to use two triangles to rotate a square of the texture per 'dot' instead of 1 gl_point per dot. I calculated the rotation per dot, then calculated the corners of the triangle to render. All of the code for calculating the interpolated rotation should still work in theory, and then update the shaders to use that rotation as input.

the old rotation was taken out around 9bfb57f, so you might still be able to compile - or at least see the code - at 5c08617.

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

1 participant