Name: Craters or Domes

Image:

Craters or Domes

Description: An image of the lunar surface. By clicking on the image and dragging your mouse downward you will rotate the image.
When you turn the image upside down the domes appear to be craters. You can experiment and find out how far you have to rotate the image to turn craters into domes.

Creator: Patio Plasma, script by Catherine Omega

Location: http://slurl.com/secondlife/Sploland/174/30/26/

Graphics:

Sign

To rotate the image click on it and drag down.

Notecard given by touching the name sign

Craters Or Domes?

To Do and Notice

Look at the image of the surface of the moon.
Does it show craters or domes?

Click on the image and drag the mouse down until it flips over.

Now does it show craters or domes?

What's Going On?

The human visual system analyzes pictures assuming that the light in the picture comes from above.
If the light actually comes from below, then depressions will be seen as mounds.

So What?

Scientists analyzing photos of moons and planets must undertand this illusion.

Etc.

Chickens see this illusion!

Chickens trained to peck bumps will peck on a photo of depressions if the light in the photo comes from below.

Lessons: The image automatically returns to its initial position after 10 seconds without a movement of the mouse.

This program has 4 states Default, Waiting_for_touch, touching, and timer_running

The state "touching" does the work of rotating the prim. The key command here is llDetectedGrab(0);

// Exploratorium Illusion - Vanna/Patio 1.0
// Catherine Omega
// rotates an object when being dragged.


// global variables are declared
float gTimeout = 10.0; // __ secs after someone has played with this, reset the rotation.
rotation gDefaultRot = ZERO_ROTATION;
key gCurrentUser = NULL_KEY;
string gCurrentUserName = "";

default


{
state_entry()
{
llSetStatus(STATUS_BLOCK_GRAB, TRUE);
llSetRot(gDefaultRot);
state waiting_for_touch;
}
}

state waiting_for_touch


{
state_entry()
{
llSetRot(gDefaultRot);
gCurrentUser = NULL_KEY;
gCurrentUserName = "";
}

// the first person to touch this will have touch control until __ seconds after they last touch it.
touch_start(integer num_detected)
{
gCurrentUser = llDetectedKey(0);
gCurrentUserName = llDetectedName(0);

state touching;
}
}

state touching


{
state_entry()
touch(integer num_detected)
{
integer i;
for (i = 0; i < num_detected; i++)
{
if (llDetectedKey(i) == gCurrentUser)
{
vector grab = llDetectedGrab(0);
vector euler = <0,grab.y,0>; // grab.y is the y component of the grab vector
rotation end_rot = llEuler2Rot(euler);
rotation current_rot = llGetRot();
end_rot = current_rot + end_rot;
llSetRot(end_rot);
}
}
}

// automatically go to the timer state; this is so we don't
touch_end(integer num_detected)
{
state timer_running;
}
}

state timer_running


{
state_entry()
{
llSetTimerEvent(gTimeout);
}

touch_start(integer num_detected)
{
integer i;
for (i = 0; i < num_detected; i++)
{
if (llDetectedKey(0) == gCurrentUser)
{
state waiting_for_touch;
}
}
}

timer()
{
state waiting_for_touch;
}
}

Comments:

 

 

Patio Plasma

Copyright 2007

Updated 28 May 2007