<div dir="ltr">I would like to ask a question or two. I'm a bit puzzled with how shifting around things in fluxus-space works, and I guess that the fact that my vector maths isn't really good isn't helping, neither does my patchy understanding of the statemachine :) I think I'm also pretty ancored in the SuperCollider OOP way of thinking, so exploring Scheme means in many ways a new steep learning curve.<br>
The problem that I am frequently encountering is that I have (sets of) objects that 'run away' from me, so to speak, and I have difficulty finding values that produce intersting things one can actually see. I think that is to do with the fact that translating objects uses vectors, rather than coordinates. So in the example below I can see how the thing is running off the scene. My question really is 1) could someone maybe explain quickly the 'unit' of the vectors i.e. if we have (vadd current-position (vector 0.1 0 0)) is the 0.1 simply a magnitude, or pixels? /me is puzzled :S .... 2) how do people manage movement of objects so that they are on-screen doing things and don't immediately wonder off?<br>
<br>sorry if this sounds really naive, it may well be :)<br><br>(clear-colour (vector 0.1 0.1 0.1))<br><br>(clear)<br>(reset-camera)<br><br>(hint-none)<br>(hint-wire)<br>(hint-vertcols)<br>(hint-solid)<br><br>(define numobs 10)<br>
<br>(define myobs (build-list numobs<br>    (lambda (object)<br>        (build-sphere 5 5))))<br><br>(define (init-object)<br>    (for-each<br>        (lambda (object)<br>            (with-primitive object<br>                (pdata-map!<br>
                    (lambda (colour)<br>                        (vector (flxrnd) (flxrnd) (flxrnd)))<br>                    "c")))<br>        myobs))<br><br>(init-object)<br><br>(define (update-object)<br>    (for-each <br>
        (lambda (object)<br>            (with-primitive object<br>                (pdata-map!<br>                    (lambda (pos)<br>                        (vsub pos (vmul pos (flxrnd))))<br>                    "p")))<br>
        myobs))<br><br>(every-frame (update-object))<br><br>Thanks,<br><br>Karsten<br></div>