Page 1 of 1

In-World Pattern Renderer

Posted: Fri May 19, 2023 3:36 am
by beholderface
A hex that takes a pattern and two numbers, and generates a list of offsets which you can use to display a pattern in-world via Hexal's Particles spell.
The first number is the scale of the displayed pattern (giving it 1 means that each stroke will be 1 block long), and the second number is degrees to rotate it around the y axis, starting from the pattern facing towards +Z at 0, and going counterclockwise as the number increases (I couldn't figure out how to implement rotation such that it can face an arbitrary axis).
Supports impossible patterns if you can get them, or you could remove the Scrivener's Purification so that you can give it strings representing patterns that you can't get in iota form.
Requires MoreIotas and Hexal.

Image

Code: Select all

//have parameter iotas on stack (pattern, scale, degrees to rotate around y)
//grab pattern, put all parameters in ravenmind
Numerical Reflection: 3
Flock's Gambit
Gemini Decomposition
Huginn's Gambit
Numerical Reflection: 0
Selection Distillation
Scrivener's Purification
//strip out non-useful information
Numerical Reflection: 11
Prospector's Gambit
Length Distillation: Str
Numerical Reflection: 1
Subtractive Distillation
Winnowing Distillation
//split into intital direction and further strokes
Spacing Reflection
Separation Distillation
Flock's Disintegration
Jester's Gambit
//lookup table
{
    //embedded list
    <["EAST",0,"NORTH_EAST",60,"NORTH_WEST",120,"WEST",180,"SOUTH_WEST",240,"SOUTH_EAST",300]>
}
Flock's Disintegration
Gemini Decomposition
//get corresponding value
Rotation Gambit
Locator's Distillation
Numerical Reflection: 1
Additive Distillation
Selection Distillation
//turn value into radians
Arc's Reflection
Numerical Reflection: 180
Division Distillation
Multiplicative Distillation
//turn radian value into a rotation matrix
Vector Reflection +Z
Jester's Gambit
Rotation Distillation
//scale and rotate an initial vector 
Vector Reflection +X
Muninn's Reflection
Numerical Reflection: 1
Selection Distillation
Multiplicative Distillation
Transformation Purification
Multiplication Distillation: Matrix
//stick first direction matrix onto end of ravenmind
Gemini Decomposition
Muninn's Reflection
Jester's Gambit
Integration Distillation
Huginn's Gambit
Restoration Purification
Single's Purification
Jester's Gambit
//split remaining string into a list of single-character strings, and delete blank characters from list
Blank Reflection
Separation Distillation
Numerical Reflection: 0
Excisor's Distillation
Retrograde Purification
Numerical Reflection: 0
Excisor's Distillation
Retrograde Purification
//thoth pattern list
{
    //get rid of superfluous iotas in the thoth execution
    Flock's Reflection
    Flock's Gambit
    Gemini Decomposition
    Abacus Purification
    Numerical Reflection: 1
    Subtractive Distillation
    Selection Distillation
    Muninn's Reflection
    Numerical Reflection: 3
    Selection Distillation
    Jester's Gambit 
    //turn character into rotation value
    {
        <["w",0,"q",60,"a",120,"s",180,"d",240,"e",300]>
    }
    Flock's Disintegration
    Gemini Decomposition
    Rotation Gambit
    Locator's Distillation
    Numerical Reflection: 1
    Additive Distillation
    Selection Distillation 
    //turn value into radians
    Arc's Reflection
    Numerical Reflection: 180
    Division Distillation
    Multiplicative Distillation 
    //produce rotation matrix
    Vector Reflection +Z
    Jester's Gambit
    Rotation Distillation 
    //rotate the matrix
    Jester's Gambit
    Multiplication Distillation: Matrix
    //put new matrix into ravenmind, then turn it into vector and leave it on stack for thoth output to have
    Gemini Decomposition
    Muninn's Reflection
    Numerical Reflection: 3
    Rotation Gambit
    Surgeon's Exaltation
    Huginn's Gambit
    Restoration Purification
}
Jester's Gambit
Thoth's Gambit
Combination Distillation
//second thoth list, to make the pattern face how you want it to
{
    //get rid of superfluous iotas in the thoth execution
    Flock's Reflection
    Flock's Gambit
    Gemini Decomposition
    Abacus Purification
    Numerical Reflection: 1
    Subtractive Distillation
    Selection Distillation //stack state: vector to rotate
    Transformation Purification
    //get rotation matrix
    Vector Reflection +Y
    Muninn's Reflection
    Numerical Reflection: 2
    Selection Distillation
    Arc's Reflection
    Numerical Reflection: 180
    Division Distillation
    Multiplicative Distillation
    Rotation Distillation
    //rotate
    Jester's Gambit
    Multiplication Distillation: Matrix
}
Jester's Gambit
Thoth's Gambit
//any medthod to get the coordinates where you want to produce the particles (though you could just save the offset list here to use it without meta-eval consumption later)
Speaker's Distillation
Running Sum Purification
Particles
Demonstration video