Create Journals
Update Journals

Journals
Find Users
Random

Read
Search
Create New

Communities
Latest News
How to Use

Support
Privacy
T.O.S.

Legal
Username:
Password:

ClaudiusMaximus (claudiusmaximus) wrote,
@ 2006-02-28 23:21:00
Previous Entry  Add to memories!  Add to Topic Directory  Tell a Friend!  Next Entry

    Current mood:geometrical
    Current music:BBC Radio 4

    Polyhedra

    More fun with Fluxus - I've been learning how to use (build-polygons), where you define the vertices that make up the faces (and the normals to the faces which control lighting). I had a heck of a time getting the tetrahedron working, I found that (recalc-normals) didn't work in a way that was suitable. The function (hint-normal) shows the normals as red lines, so you can check they are pointing in the right directions, very helpful. Once I got used to it, making an octahedron was much easier.

    Cube and Octahedron

    Cube and Octahedron

    Five Tetrahedra (left-handed and right-handed variants)

    Five Tetrahedra

    Five Tetrahedra

    Ten Tetrahedra (some misalignment due to rounding errors or mistakes in my maths)

    Ten Tetrahedra

    (define (pow a b) (exp (* (log a) b)))
    
    (define (build-octahedron)
      (let ((ob (build-polygons 24 2))
            (L (pow (/ 1 3) (/ 1 3)) )
            (-L (- 0 (pow (/ 1 3) (/ 1 3))))
           )
    
        (grab ob)
    
        (pdata-set "p"  0 (vector  1  0  0))
        (pdata-set "p"  1 (vector  0  1  0))
        (pdata-set "p"  2 (vector  0  0  1))
    
        (pdata-set "p"  3 (vector  1  0  0))
        (pdata-set "p"  4 (vector  0  0  1))
        (pdata-set "p"  5 (vector  0 -1  0))
    
        (pdata-set "p"  6 (vector  1  0  0))
        (pdata-set "p"  7 (vector  0 -1  0))
        (pdata-set "p"  8 (vector  0  0 -1))
    
        (pdata-set "p"  9 (vector  1  0  0))
        (pdata-set "p" 10 (vector  0  0 -1))
        (pdata-set "p" 11 (vector  0  1  0))
    
        (pdata-set "p" 12 (vector -1  0  0))
        (pdata-set "p" 13 (vector  0  0  1))
        (pdata-set "p" 14 (vector  0  1  0))
    
        (pdata-set "p" 15 (vector -1  0  0))
        (pdata-set "p" 16 (vector  0 -1  0))
        (pdata-set "p" 17 (vector  0  0  1))
    
        (pdata-set "p" 18 (vector -1  0  0))
        (pdata-set "p" 19 (vector  0  0 -1))
        (pdata-set "p" 20 (vector  0 -1  0))
    
        (pdata-set "p" 21 (vector -1  0  0))
        (pdata-set "p" 22 (vector  0  1  0))
        (pdata-set "p" 23 (vector  0  0 -1))
    
    
        (pdata-set "n"  0 (vector  L  L  L))
        (pdata-set "n"  1 (vector  L  L  L))
        (pdata-set "n"  2 (vector  L  L  L))
    
        (pdata-set "n"  3 (vector  L -L  L))
        (pdata-set "n"  4 (vector  L -L  L))
        (pdata-set "n"  5 (vector  L -L  L))
    
        (pdata-set "n"  6 (vector  L -L -L))
        (pdata-set "n"  7 (vector  L -L -L))
        (pdata-set "n"  8 (vector  L -L -L))
    
        (pdata-set "n"  9 (vector  L  L -L))
        (pdata-set "n" 10 (vector  L  L -L))
        (pdata-set "n" 11 (vector  L  L -L))
    
        (pdata-set "n" 12 (vector -L  L  L))
        (pdata-set "n" 13 (vector -L  L  L))
        (pdata-set "n" 14 (vector -L  L  L))
    
        (pdata-set "n" 15 (vector -L -L  L))
        (pdata-set "n" 16 (vector -L -L  L))
        (pdata-set "n" 17 (vector -L -L  L))
    
        (pdata-set "n" 18 (vector -L -L -L))
        (pdata-set "n" 19 (vector -L -L -L))
        (pdata-set "n" 20 (vector -L -L -L))
    
        (pdata-set "n" 21 (vector -L  L -L))
        (pdata-set "n" 22 (vector -L  L -L))
        (pdata-set "n" 23 (vector -L  L -L))
    
        (finalise)
    
        (ungrab)
    
        ob
    
      )
    )


(Read comments)

Post a comment in response:

From:
 
Username:  Password: 
Subject:
No HTML allowed in subject
 Don't auto-format:
Message:
Enter the security code below.


Notice! This user has turned on the option that logs your IP address when posting.

Allowed HTML: <a> <abbr> <acronym> <address> <area> <b> <bdo> <big> <blockquote> <br> <caption> <center> <cite> <code> <col> <colgroup> <dd> <dd> <del> <dfn> <div> <dl> <dt> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr> <i> <img> <ins> <kbd> <li> <li> <map> <marquee> <ol> <p> <pre> <q> <s> <samp> <small> <span> <strike> <strong> <sub> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <tt> <u> <ul> <var> <xmp>
© 2002-2008. Blurty Journal. All rights reserved.