Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] PsychoPy Rotation and DotLife

edited April 2015 in OpenSesame

Hi

My question refers to the coder view and elementarraystim in Psychopy.

The visual stimulus that I require moves radially inwards and outwards, and rotates as it moves (like a twisting motion). It is an optic flow stimulus.
I have created the radial flow, but I can't work out how to make the dots rotate.
Any advice / equation would be well received!

Also, I want to make each of the dots have a random dot life between 1 and 100, then on each frame decrement the dot life of every dot. Then I am trying to search for any that have a dot life of zero and change the corresponding (x,y) values to new random values and reset the dot life back to 100 - but I am having difficulty implementing this. Again any help would be much appreciated.

Thanks,

Phoebe

Comments

  • edited 1:40AM

    Hi Phoebe,

    What exactly do you have right now? Could you post/ upload the relevant script, or the entire experiment?

    Cheers,
    Sebastiaan

  • edited July 2016

    Hi

    I've used the following code, to get the dots to move outward from the center, how can I adjust it so they move inwards

    for frameN in range(300):
        # update radius
        dotsRadius = (dotsRadius+speed)
        # random radius where radius too large
        outFieldDots = (dotsRadius>=fieldSize)
        dotsRadius[outFieldDots] = numpy.random.rand(sum(outFieldDots))*fieldSize
        dotsX, dotsY = pol2cart((dotsTheta),(dotsRadius))
        dots.setXYs(numpy.array([dotsX, dotsY]).transpose())
        dots.draw() 
        win.flip()
    

    Thanks,
    Ainsley

  • edited 1:40AM

    Hey Ainsley,

    Would you mind providing a functioning example? I'm sure that the part that you posted earlier does indeed make the dots move outward. However, the more general part of the code is missing (initialization of the window, setting up the parameters, etc. ). Before I can start playing around with the code, I would need to spend time to make your example work. It would be easier if you could just post as much of your code as necessary to make your code executable by anyone.

    Thanks,

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.