-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6586740
commit df2db43
Showing
7 changed files
with
64 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
original_author: Patricio Gonzalez Vivo | ||
description: returns a 2x2 scale matrix | ||
use: scale2d(<float> radians) | ||
*/ | ||
|
||
#ifndef FNC_SCALE4D | ||
mat2 scale2d(float _scale) { | ||
return mat2( | ||
_scale, 0.0, | ||
0.0, _scale, | ||
); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
original_author: Patricio Gonzalez Vivo | ||
description: returns a 3x3 scale matrix | ||
use: scale3d(<float> radians) | ||
*/ | ||
|
||
#ifndef FNC_SCALE4D | ||
mat3 scale3d(float _scale) { | ||
return mat3( | ||
_scale, 0.0, 0.0, | ||
0.0, _scale, 0.0, | ||
0.0, 0.0, _scale, | ||
); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
original_author: Inigo Quiles | ||
description: repeat operation for 2D/3D SDFs | ||
use: <vec4> opElongate( in <vec3> p, in <vec3> h ) | ||
*/ | ||
|
||
#ifndef FNC_OPREPEAT | ||
#define FNC_OPREPEAT | ||
|
||
vec2 opRepeat( in vec2 p, in float s ) { | ||
return mod(p+s*0.5,s)-s*0.5; | ||
} | ||
|
||
vec3 opRepeat( in vec3 p, in vec3 c ) { | ||
return mod(p+0.5*c,c)-0.5*c; | ||
} | ||
|
||
vec2 opRepeat( in vec2 p, in vec2 lima, in vec2 limb, in float s ) { | ||
return p-s*clamp(floor(p/s),lima,limb); | ||
} | ||
|
||
vec3 opRepeat( in vec3 p, in vec3 lima, in vec3 limb, in float s ) { | ||
return p-s*clamp(floor(p/s),lima,limb); | ||
} | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.