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 koch sdf #88

Merged
merged 3 commits into from
Aug 6, 2023
Merged

Conversation

kfahn22
Copy link
Contributor

@kfahn22 kfahn22 commented Aug 3, 2023

While this is not an exact copy of The Art of Code's version of the Koch curve, it is essentially his code. I have added if statements to choose different iterations. I couldn't find a function that returned vec2(sin(angle), cos(angle)). Please let me know if there is one that can be utilized.

@kfahn22
Copy link
Contributor Author

kfahn22 commented Aug 5, 2023

BTW, I am playing around with the code in morphological and get this error trying to use alphaFill (which is why I added if statements to the koch curve code.) I am using p5.js.

's' : Loop index cannot be compared with non-constant expression

@patriciogonzalezvivo
Copy link
Owner

Have you add the following line to the top of your code?

#define PLATFORM_WEBGL

There is no dynamic arrays on WebGL 1.0, that flag before importing any function, changes the code to be back compatible with WebGL1.0

sdf/kochSDF.glsl Outdated
#include "../math/const.glsl"

/*
original_author: The Art of Code

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should put the name of the person instead of his youtube channel?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I used Art of Code because another file referred to the original author that way.

@kfahn22
Copy link
Contributor Author

kfahn22 commented Aug 5, 2023

I followed the pattern for alphaFill to add loop-please let me know if I need to fix.

@patriciogonzalezvivo patriciogonzalezvivo merged commit 4e8c9ea into patriciogonzalezvivo:main Aug 6, 2023
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.

None yet

2 participants