Referencia › Movement and Pose — 110 comandos


anchor

movement and pose

Entrada: none
Salida: list

Returns the location of the current anchor. The anchor is the 'pivot point' of the orbit commands and pullin / pullout.

show anchor

around

movement and pose

Entrada: position (list) | vector (list) | length (number) | radius (number)
Salida: turtles (list)

Returns a list of turtles within the cylinder created by the given parameters, in the direction indicated by the vector away from the position with the given length and radius. Useful for collision detection. See also inside, encroaching.

snappy:show without turtle around position forwarddir 200 20
[myrtle]

autoorbit

movement and pose

Entrada: direction (word) | degrees (number) | time (60ths of a second)
Salida: none

Automatically orbits the current view turtle in the specified direction the specified number of degrees every specified 60ths of a second. noautoorbit turns it off. Subsequent autoorbits cancel previous ones.

autoorbit "left 2 5
autoorbit "up 0.5 10

back

También: bk

movement and pose

Entrada: turtlesteps (number)
Salida: none

Mueve la tortuga actual hacia atrás el número de pasos de tortuga indicado.

back 20

barriers

movement and pose

Entrada: none
Salida: list

Lists the existing barriers. See setbarriers

show barriers

direction

movement and pose

Entrada: position (list)
Salida: vectors (list)

Returns a list of vectors that would point the calling turtle at the supplied list of co-ordinates.

show direction myrtle:position snappy:position
[[0 1 0] [0 0 1] [1 0 0]]
snappy:setvectors direction myrtle:position

distance

movement and pose

Entrada: position (list) | position (list)
Salida: distance (number)

Devuelve la distancia del primer par de coordenadas al segundo. distance admite una lista [X Y Z] o una lista [X Y], tomando Z como 0

show distance myrtle:position snappy:position
show distance [0 0 0] [100 100 100]

divergence

movement and pose

Entrada: [vector1 vector2] (list) | [vector3 vector4] (list)
Salida: degrees (number)

Divergence returns the degrees of difference (divergence) between vector1 and vector3 in a clockwise direction, that direction established using vector2 and vector4, which need to be the axis you would be pivoting on to measure that difference. So if you're measuring the degrees of difference between two forward vectors in terms of left and right, the second vector needs to be the up vector. If you were measuring the difference in terms of up and down, you would give the right vector. Divergence is extremely useful for ball games.

show divergence {item 1 myrtle:vectors item 3 myrtle:vectors} {item 1 snappy:vectors item 3 myrtle:vectors}
90

down

También: dn

movement and pose

Entrada: degrees (number)
Salida: none

Baja el morro de la tortuga que llama el número de grados indicado. Véase up

down 45

drift

movement and pose

Entrada: steps vector
Salida: none

Causes the selected turtle to 'drift' the specified number of steps in the direction specified by vector. You can use drift to simulate momentum or gravity, particularly in concert with workers. See forwarddir

drift 10 forwarddir
forward 10 make "forward forwarddir newworker [repeat 5 [drift 1 :forward]]

dropanchor

movement and pose

Entrada: none
Salida: none

Sets the selected turtle's orbit anchor point to its current position. See setanchor

repeat 10 [penup forward 60 dropanchor pullout 50 pendown repeat 36 [orbitleft 10]]

encroaching

movement and pose

Entrada: position (list) | vectors (list) | [left right forward backward above below] (list)
Salida: turtles (list)

Returns a list of turtles encroaching within the 'box' specified by the third list input. This is a more sophisticated version of inside, which allows for a box of any orientation, based on the provided vectors. See around, inside

show encroaching position vectors [10 10 10 10 10]

extrapolate

movement and pose

Entrada: position (list) | vector (list) | distance (number)
Salida: list

Returns a list of target co-ordinates based on the starting position, a vector and the distance in turtle-units along that vector.

show extrapolate position forwarddir 5

face

movement and pose

Entrada: position (list of 3) | position (list of 3)
Salida: vector (list)

face takes two lists of co-ordinates (x, y and z) and then returns a list of vectors (list of three lists of three) which if applied to a turtle cause it to 'face' the second set of co-ordinates if positioned at the first set of co-ordinates.

setvectors face position [100 100 100]

facingp

movement and pose

Entrada: co-ordinates (list) | degrees (number)
Salida: boolean

returns true if a vector from the calling turtle to the supplied co-ordinates diverges less than the supplied number of degrees from the calling turtle's forward vector. See divergence

reset
snappy:show facingp myrtle:position 10
true
myrtle:show facingp snappy:position 10
false

fence

movement and pose

Entrada: none
Salida: none

Detiene la tortuga que llama si alcanza los límites de pantalla fijados por setbounds. Véase setbounds, bounds, window, wrap, hitboundsp

fence

fixate

También: fix

movement and pose

Entrada: position
Salida: none

Both sets the anchor point and points the selected turtle at it. Compare with setanchor, which does not change the orientation of the selected turtle.

snappy:fixate myrtle:position
fixate [0 0 0]
points Snappy (the camera turtle) at Myrtle.

forward

También: fd

movement and pose

Entrada: turtle-spaces (number)
Salida: none

Mueve la tortuga hacia adelante el número de pasos de tortuga indicado. Dibuja una línea si el lápiz está bajado. Véase pendown, back

forward 20

forwarddir

movement and pose

Entrada: none
Salida: vector (list)

Returns the calling turtle's forward vector. See backdir

show forwarddir

backdir

movement and pose

Entrada: none
Salida: vector (list)

Returns the calling turtle's back vector. See forwarddir

show backdir

heading

También: hd

movement and pose

Entrada: none
Salida: degrees

Devuelve el rumbo (eje x) de la tortuga seleccionada, en grados. El rumbo es un valor relativo acumulado que por sí solo no basta para reproducir con exactitud una orientación cuando la tortuga se mueve en tres dimensiones; para eso, use orientation / setorientation. Véase pitch y roll

print heading

home

movement and pose

Entrada: none
Salida: none

Devuelve la tortuga seleccionada a su posición inicial.

home

inside

movement and pose

Entrada: [[x1 y1 z1] [x2 y2 z2]]
Salida: list

Returns a list of turtles inside the area denoted by the provided sets of co-ordinates.

show inside [[-100 -100 -100] [100 100 100]
[myrtle]

jump

movement and pose

Entrada: steps (number)
Salida: none

Mueve la tortuga hacia adelante el número de pasos de tortuga indicado sin dibujar, sea cual sea el estado del lápiz.

jump 20

left

También: lt

movement and pose

Entrada: degrees
Salida: none

Gira la tortuga seleccionada hacia la izquierda el número de grados indicado. Véase right

left 90
lt 45

leftarc

También: larc

movement and pose

Entrada: degrees or [degrees segments] | radius
Salida: none

Crea un arco hacia adelante y hacia la izquierda desde la posición de la tortuga, dejándola en su extremo. Los arcos no cruzan los bordes limpiamente en modo wrap. Si el primer parámetro es una lista, el primer valor son los grados y el segundo el número de segmentos del arco, que sustituye al algoritmo interno usado para calcularlos. Véase rightarc

leftarc 90 40

location

movement and pose

Entrada: co-ordinates (list)
Salida: list

Returns a list of isRight, isAbove, isAhead where a value of 1 indicates the target co-ordinates are in those areas relative to the turtle's forward view, 0 indicates that the co-ordinates are on the same plane as the calling turtle as appropriate, and -1 indicates the co-ordinates are in the opposite region (eg a -1 for isRight indicates it is to the left of the turtle's forward vector / view).

snappy:show location myrtle:position
[0 0 1]
myrtle:show location snappy:position
[0 1 0]

lower

También: lo

movement and pose

Entrada: turtle-units
Salida: none

Baja la tortuga (la desplaza hacia atrás a lo largo de su vector vertical). Equivale a down 90 forward turtle-units up 90. Por ejemplo, Myrtle en su posición inicial al arrancar turtleSpaces se alejará de la tortuga cámara Snappy si la baja. Véase raise

lower 100

move

movement and pose

Entrada: distance (turtle-units) | degrees OR [degrees degrees] OR [[vector]]
Salida: none

Mueve la tortuga en la dirección indicada el número de unidades de tortuga indicado, sin alterar su orientación ni sus vectores. Si se indica una lista de dos valores, se mueve primero en horizontal (primer valor) y luego en vertical (segundo valor).

move 20 45
move 20 [45 45]
repeat 3600 [move repcount / 1000 repcount]

near

movement and pose

Entrada: position (list) | radius (number) OR [radius group] (list)
Salida: list

Returns a list of all the turtles within the specified radius of turtle-units from the specified position. If a list is provided for the second parameter, only members of the specified group are returned. See nearme

show near [0 0 0] 10

nearme

movement and pose

Entrada: distance (number) OR [distance group] (list)
Salida: turtles (list)

Returns a list of turtles within the specified distance of the calling turtle, except the calling turtle itself. If a list is provided, the first entry is distance, the second entry is the group – only members from this group are returned. See near, nearp

show nearme 200
show nearme [20 turtles]

noautoorbit

movement and pose

Entrada: none
Salida: none

Turns off any existing autoorbit. See autoorbit.

noautoorbit

nostealth

movement and pose

Entrada: none
Salida: none

Causes calling turtle to appear in lists generated by near. See stealth

nostealth

notether

movement and pose

Entrada: none
Salida: none

Untethers the selected turtle from the orbit anchor point. When the turtle is untethered, the anchor point moves relative to it.

notether

orbitdistance

movement and pose

Entrada: none
Salida: turtle-units (number)

Returns the distance between a turtle and its anchor point. See setanchor, dropanchor

show orbitdistance

orbitdown

También: odn

movement and pose

Entrada: degrees (number)
Salida: none

Hace orbitar la tortuga por debajo, alrededor de su punto de anclaje, el número de grados indicado. Tenga en cuenta que la tortuga va directamente a su destino si fluid está desactivado, y que si el lápiz está bajado se dibuja una línea entre el origen y el destino sin puntos intermedios. Véase setanchor, dropanchor

orbitdown 90

orbitleft

También: olt

movement and pose

Entrada: degrees (number)
Salida: none

Hace orbitar la tortuga hacia la izquierda alrededor de su punto de anclaje el número de grados indicado. Tenga en cuenta que la tortuga va directamente a su destino si fluid está desactivado, y que si el lápiz está bajado se dibuja una línea entre el origen y el destino sin puntos intermedios. Véase setanchor, dropanchor

orbitleft 90

orbitright

También: ort

movement and pose

Entrada: degrees (number)
Salida: none

Hace orbitar la tortuga hacia la derecha alrededor de su punto de anclaje el número de grados indicado. Tenga en cuenta que la tortuga va directamente a su destino si fluid está desactivado, y que si el lápiz está bajado se dibuja una línea entre el origen y el destino sin puntos intermedios. Véase setanchor, dropanchor


orbitup

También: oup

movement and pose

Entrada: degrees (number)
Salida: none

Hace orbitar la tortuga por encima, alrededor de su punto de anclaje, el número de grados indicado. Tenga en cuenta que la tortuga va directamente a su destino si fluid está desactivado, y que si el lápiz está bajado se dibuja una línea entre el origen y el destino sin puntos intermedios. Véase setanchor, dropanchor

orbitup 90

orbitvector

movement and pose

Entrada: vector (list) | degrees (number)
Salida: none

Orbits the specified number of degrees around the turtle's anchor point using the specified vector. To orbit in the opposite direction, specify a negative number of degrees. Note that the turtle goes to its destination directly regardless of the status of fluid, and if the pen is down a line will be drawn between the start and destination with no intermediary points. See setanchor, dropanchor

orbitvector updir 10

orientation

movement and pose

Entrada: none
Salida: list

Returns the current orientation, in the order specified by orientationorder. So if orientation order is set to "phr, then the first value returned by orientation will be pitch, the second heading and the third roll. See orientationorder

show orientation

orientationorder

movement and pose

Entrada: none
Salida: word

Returns the current order heading, pitch and roll are processed when setorientation, setheading, setpitch or setroll is used.

show orientationorder
"hpr

origin

movement and pose

Entrada: none
Salida: list

Returns the current origin co-ordinates. See setorigin, home

show origin
[0 0 0]

originvectors

movement and pose

Entrada: none
Salida: list

Returns the current origin vectors. See setoriginvectors, origin, home

show originvectors

pitch

También: pt

movement and pose

Entrada: none
Salida: pitch (number)

Devuelve el cabeceo (actitud) de la tortuga actual

print pitch

pos

movement and pose

Entrada: none
Salida: [x y] (list)

Devuelve las coordenadas x e y de la tortuga. Para las tres dimensiones, véase position

show pos

position

movement and pose

Entrada: none
Salida: [x y z] (list)

Devuelve las coordenadas de la tortuga. Para solo las dos primeras dimensiones, véase pos

show position

project

movement and pose

Entrada: [x% y% (Z)] (list)
Salida: list

Returns a list containing the associated X and Y coordinates of the given percentage values as returned by mousex and mousey, assuming the given Z plane (or 0 if not provided). You can use this to set the turtle position to the mouse pointer position. This currently only works if the camera is in its home position. See mousex, mousey

show project [50 20]
setpos project {mousex mousey}

pullin

También: pui

movement and pose

Entrada: turtle-spaces (number)
Salida: none

Acerca la tortuga que llama hacia su punto de anclaje el número de espacios de tortuga indicado. Se detiene si alcanza el punto de anclaje.

pullin 40

pullout

También: puo

movement and pose

Entrada: turtle-spaces (number)
Salida: none

Aleja la tortuga que llama de su punto de anclaje el número de espacios de tortuga indicado.

dropanchor repeat 20 [penup pullout 10 pendown repeat 36 [orbitleft 10]]

raise

También: ra

movement and pose

Entrada: turtle-units (number)
Salida: none

Eleva la tortuga seleccionada el número de unidades de tortuga indicado. Dibuja una línea si el lápiz está bajado. Véase lower

raise 20

randomheading

También: randhead

movement and pose

Entrada: none
Salida: none

Orienta la tortuga en un rumbo (dirección) aleatorio.

randomheading

randomposition

También: randpos

movement and pose

Entrada: none
Salida: none

Coloca la tortuga en una posición aleatoria dentro de sus límites actuales, en el plano Z actual. Véase bounds

randomposition

randomvectors

También: randvec

movement and pose

Entrada: none
Salida: none

Orients the currently selected turtle randomly in three dimensions. This does NOT alter the current pitch, heading or roll values.

pendown repeat 10 [randomvectors fd 100 home]

relative

movement and pose

Entrada: [x y z] (list)
Salida: [heading pitch] (list)

Returns the relative heading and pitch adjustments, as a list, required to turn the calling turtle from its current orientation to face the provided 3D co-ordinate. Unlike towards, relative considers the full [x y z] position and the turtle's current view direction, so it works at any orientation. Applying the result as right first relative [x y z] followed by up second relative [x y z] will point the turtle at the target. The smaller (possibly negative) angle is always returned. See towards, setheading.

right first relative [30 40 50] up second relative [30 40 50]

right

También: rt

movement and pose

Entrada: degrees
Salida: none

Gira la tortuga seleccionada hacia la derecha el número de grados indicado. Si el número de grados es negativo, gira hacia la izquierda. Véase left

right 90

rightarc

También: rarc

movement and pose

Entrada: degrees or [degrees segments] | radius
Salida: none

Crea un arco hacia adelante y hacia la derecha desde la posición de la tortuga, dejándola en su extremo. Los arcos no cruzan los bordes con precisión en modo wrap. Si el primer parámetro es una lista, el segundo elemento indica el número de segmentos que se usarán para construir el arco. Véase leftarc

rightarc 90 40

rightdir

movement and pose

Entrada: none
Salida: vector

Returns the right vector of the selected turtle. See leftdir

show rightdir

leftdir

movement and pose

Entrada: none
Salida: vector

Returns the left vector of the selected turtle. See rightdir

show leftdir

roll

También: ro

movement and pose

Entrada: none
Salida: number

Devuelve el valor de alabeo actual. Véase setroll

show roll

rollleft

También: rl

movement and pose

Entrada: degrees (number)
Salida: none

Alabea la tortuga seleccionada hacia la izquierda el número de grados indicado.

rollleft 90

rollright

También: rr

movement and pose

Entrada: degrees (number)
Salida: none

Alabea la tortuga seleccionada hacia la derecha el número de grados indicado.

rollright 45

setanchor

movement and pose

Entrada: position (list) [X Y (Z)]
Salida: none

Sets the selected turtle's orbit anchor to the specified two or three-dimensional position. Compare with fixate.

setanchor [50 20] ;no Z (implied 0)
setanchor [0 0 10] ;with Z

setbarriers

movement and pose

Entrada: [[[x1 y1 z1][x2 y2 z2]][[x3 y3 z3][x4 y4 z4]]…] (list of lists)
Salida: none

Sets barriers on the calling turtle. The calling turtle cannot venture into the defined area(s). See barriers

setbarriers [[[0 0 0][100 100 100]]]

setbounds

También: sbds

movement and pose

Entrada: x1 y1 x2 y2 (list) OR [[x1 y1 z1][x2 y2 z2]] (list of lists) OR radius
Salida: none

Fija el límite que usan wrap y fence. Si se indica un solo valor, el límite es el radio de un círculo o esfera centrado en el origen actual. Si ese único valor es negativo, el límite es un hemisferio apoyado en Z, es decir, la tortuga no puede avanzar hacia valores negativos de Z. Si no se indican valores de Z, se fijan en -1000 / 1000. Los límites predeterminados son [[-212 -119 100] [212 119 100]], con el formato [[x1 y1 z1] [x2 y2 z2]], lo que da un área de visualización de 424 unidades de tortuga de ancho, 238 de alto y 200 de profundidad. Véase bounds, fence, wrap

setbounds [-100 -100 100 100]
setbounds [[-100 -100 -100][100 100 100]

setheading

También: seth shd

movement and pose

Entrada: degrees (number)
Salida: none

Establece el rumbo de la tortuga (izquierda-derecha) y actualiza su orientación en consecuencia. Tenga en cuenta que, aunque setheading modifica el valor del rumbo a efectos de la orientación, si se usa de forma aislada setorientation puede no restaurar la orientación esperada. Si piensa usar setorientation para restaurar la orientación de una tortuga, utilice también setorientation para cambiar los distintos aspectos de esa orientación. Véase orientation

setheading 90

setorbitdistance

movement and pose

Entrada: turtle-units (number)
Salida: none

Sets the currently selected turtle's distance from its anchor point.

setorbitdistance 100

setorientation

movement and pose

Entrada: vectors (list)
Salida: none

First unwinds the current orientation in the reverse of orientationorder, then changes the calling turtle's orientation in the order specified by orientationorder, so that if orientationorder is "PHR then the first orientation changed is pitch, then heading, then the roll. Due to the nature of 3D movements, setorientation can only be used to restore orientations that are the result of relatively simple transforms (that is, series of orientation changing commands such as rollright or down). To restore complex orientations, use both setorientation and setvectors. See setvectors

setorientation [0 90 0]

setorientationorder

movement and pose

Entrada: order (word)
Salida: none

Sets the order in which heading, pitch and roll are processed after using setheading, setpitch or setroll. The required word is a three letter combination made up of h, for heading, p, for pitch, and r, for roll. See orientationorder

setorientationorder "hpr
setorientationorder "rhp

setorigin

movement and pose

Entrada: [x y z] (list)
Salida: none

Sets the turtle's origin, the location it goes when it goes home. See origin, home

setorigin [50 50 50]

setoriginvectors

movement and pose

Entrada: vectors (list)
Salida: none

Sets the turtle’s origin vectors, the orientation the turtle ends up in when it goes home. See originvectors, vectors, home

setoriginvectors vectors

setpitch

También: setp spi

movement and pose

Entrada: degrees (number)
Salida: none

Sets the turtle's pitch (up-down) and updates its orientation appropriately. Be aware that while setpitch will alter the value of pitch for the purposes of orientation, setorientation may not restore the expected turtle orientation if setpitch is used in isolation. If you intend to use setorientation to restore a turtle's orientation, you should use setorientation to change aspects of a turtle's orientation also. See orientation

setpitch 180

setposition

También: setpos spo

movement and pose

Entrada: [x y (z)] (list) OR [[x1 y1 z1] [x2 y2 z2]…]
Salida: none

Establece las coordenadas de la tortuga. Si el lápiz está bajado, se dibuja una línea entre la posición anterior y la nueva. Si se pasa a setposition una lista de listas, se dibujan líneas que unen esos puntos (con el lápiz bajado) y la tortuga queda en la última posición indicada.

setpos [20 30]
setposition [10 20 30]
pendown repeat 100 [setposition {-200 + random 400 -200 + random 400 -200 + random 400}]

setroll

También: setr sro

movement and pose

Entrada: degrees (number)
Salida: none

Sets the turtle's roll (rollleft-rollright) and updates its orientation appropriately. Be aware that while setroll will alter the value of roll for the purposes of orientation, setorientation may not restore the expected turtle orientation if setroll is used in isolation. If you intend to use setorientation to restore a turtle's orientation, you should use setorientation to change aspects of a turtle's orientation also. See orientation

setroll 90

setvectors

movement and pose

Entrada: [[forwarddir] [updir] [rightdir]] (list of lists)
Salida: none

Establece la orientación de la tortuga actual mediante vectores.

setvectors [1 -1 0] [1 1 1] [0 0 0]

setx

movement and pose

Entrada: number
Salida: none

Establece la posición x de la tortuga.

setx 100

setxy

movement and pose

Entrada: x (number) | y (number)
Salida: none

Sets the turtle's x and y co-ordinates. This is here for compatibility. As opposed to setpos, which takes the two co-ordinates as a list. See setpos

setxy 10 20

sety

movement and pose

Entrada: number
Salida: none

Establece la posición y de la tortuga.

sety 20

setz

movement and pose

Entrada: number
Salida: none

Establece la posición z de la tortuga.

setz 50

showme

movement and pose

Entrada: turtle
Salida: none

Causes the calling turtle to position itself in the default view turtle position over the specified turtle. Usually called by the current view (camera) turtle.

showme "myrtle

slideleft

También: sl

movement and pose

Entrada: turtle-steps
Salida: none

Desliza la tortuga hacia la izquierda el número de pasos de tortuga indicado.

slideleft 20

slideright

También: sr

movement and pose

Entrada: turtle-steps
Salida: none

Desliza la tortuga hacia la derecha el número de pasos de tortuga indicado.

slideright 30

spin

movement and pose

Entrada: [vectors] (list) | degrees
Salida: none

Gira la tortuga alrededor del vector dado el número de grados dado, en sentido horario visto desde detrás del vector, de modo que SPIN FORWARDDIR 90 equivale a ROLLRIGHT 90. No afecta al cabeceo, al rumbo ni al alabeo.

spin forwarddir 90

stealth

movement and pose

Entrada: none
Salida: none

Causes the calling turtle not to appear in lists returned by near. See nostealth

stealth

tether

movement and pose

Entrada: none
Salida: none

Tethers the selected turtle to the orbit anchor point. If the turtle moves, the anchor point remains unchanged. See setanchor, notether

tether

topedge

movement and pose

Entrada: none
Salida: number

Returns the top y co-ordinate for the bounds used by wrap and fence. See bottomedge, leftedge, rightedge, loweredge, upperedge

show topedge

bottomedge

movement and pose

Entrada: none
Salida: number

Returns the bottom y co-ordinate for the bounds used by wrap and fence. See topedge, leftedge, rightedge, loweredge, upperedge

show bottomedge

leftedge

movement and pose

Entrada: none
Salida: number

Returns the left x co-ordinate for the bounds used by wrap and fence. See topedge, bottomedge, rightedge, loweredge, upperedge

show leftedge

rightedge

movement and pose

Entrada: none
Salida: number

Returns the right x co-ordinate for the bounds used by wrap and fence. See topedge, bottomedge, leftedge, loweredge, upperedge

show rightedge

loweredge

movement and pose

Entrada: none
Salida: number

Returns the lower z co-ordinate for the bounds used by wrap and fence. See topedge, bottomedge, leftedge, rightedge, upperedge

show loweredge

upperedge

movement and pose

Entrada: none
Salida: number

Returns the upper z co-ordinate for the bounds used by wrap and fence. See topedge, bottomedge, leftedge, rightedge, loweredge

show upperedge

towards

movement and pose

Entrada: [x y] (list)
Salida: heading (number)

Devuelve el rumbo que haría que la tortuga mirara hacia las coordenadas indicadas. towards supone que la coordenada de destino está en el mismo plano Z que la tortuga. towards es una primitiva heredada de Apple Logo, útil en turtleSpaces por compatibilidad y para usos en dos dimensiones. Véase heading

setheading towards [30 40]

up

movement and pose

Entrada: degrees
Salida: none

Levanta el morro de la tortuga el número de grados indicado. Si se mira la tortuga desde arriba (la vista predeterminada), up 90 hace que apunte directamente hacia usted.

up 90

updir

movement and pose

Entrada: none
Salida: vector (list)

Returns the calling turtle's current up vector. See downdir, rightdir, forwarddir

show updir

downdir

movement and pose

Entrada: none
Salida: vector (list)

Returns the calling turtle's current down vector. See updir, rightdir, forwarddir

show downdir

unproject

movement and pose

Entrada: position (list)
Salida: [x-percent y-percent (list)

Returns the 2D position of the object as a percentage of the window / screen. For example, if the turtle appears to be in the dead center of the screen, unproject will return 50% across and 50% down. Note: If the co-ordinate is not in the view of the camera, unproject will return spurious results!

unproject myrtle:position

vectors

movement and pose

Entrada: none
Salida: [forwarddir updir rightdir]

Devuelve los vectores de orientación de la tortuga como una lista. Es el método más fiable para guardar y restaurar la orientación de una tortuga, frente a la función orientation, que devuelve valores relativos de rumbo, cabeceo y alabeo.

print vectors

xpos

También: xcor

movement and pose

Entrada: none
Salida: xpos (number)

Devuelve la coordenada x actual de la tortuga.

show xpos

ypos

También: ycor

movement and pose

Entrada: none
Salida: ypos (number)

Devuelve la coordenada y actual de la tortuga.

show ypos

zpos

También: zcor

movement and pose

Entrada: none
Salida: zpos (number)

Devuelve la coordenada z actual de la tortuga.

show zpos

zeroheading

movement and pose

Entrada: none
Salida: none

Pone a cero el valor de rumbo de la tortuga. Esto no modifica su orientación real; los cambios posteriores irán actualizando el rumbo con normalidad. Esta primitiva permite fijar un nuevo rumbo de referencia desde el que seguir trabajando. Véase heading

zeroheading

zeroorientation

movement and pose

Entrada: none
Salida: none

Zeroes the turtle's orientation values (pitch, heading, roll). This does not modify the turtle's actual orientation. Further changes will modify orientation values as appropriate. This primitive allows you to establish new base orientation values to work forward from. See orientation

zeroorientation

zeropitch

movement and pose

Entrada: none
Salida: none

Zeroes the turtle's pitch value. This does not modify the turtle's orientation. Further changes will modify pitch as appropriate. This primitive allows you to establish a new base pitch value to work forward from. See pitch

zeropitch

zeroroll

movement and pose

Entrada: none
Salida: none

Zeroes the turtle's roll value. This does not modify the turtle's orientation. Further changes will modify roll as appropriate. This primitive allows you to establish a new base roll value to work forward from. See roll

zeroroll

zoom

movement and pose

Entrada: none
Salida: number

Returns the turtle's 'zoom' value, which is relevant to its display when it is a view turtle. 100 (as in 100%) is the default value. See setzoom

show zoom

xcor

movement and pose

Entrada: none
Salida: number

Forma abreviada de xpos. Devuelve la coordenada X de la tortuga.

print xcor

ycor

movement and pose

Entrada: none
Salida: number

Forma abreviada de ypos. Devuelve la coordenada Y de la tortuga.

print ycor

zcor

movement and pose

Entrada: none
Salida: number

Forma abreviada de zpos. Devuelve la coordenada Z de la tortuga.

print zcor

polar

movement and pose

Entrada: none
Salida: list

Returns the turtle's current position in spherical polar coordinates as a list [azimuth elevation radius]. Azimuth is the horizontal angle around the Z-axis in degrees, elevation is the vertical angle from the XY plane in degrees, and radius is the distance from the origin.

setpolar [0 0 100]
show polar
[0 0 100]
setpolar [90 0 100]
show polar
[90 0 100]
setpolar [0 90 100]
show polar
[0 90 100]

setpolar

movement and pose

Entrada: [azimuth elevation (radius)]
Salida: none

Sets the turtle's position using spherical polar coordinates. Azimuth is the horizontal angle in degrees, elevation is the vertical angle in degrees, and radius is the distance from origin. If radius is omitted, the turtle maintains its current distance from the origin while moving to the specified angles.

setpolar [0 0 100]
show polar
[0 0 100]
setpolar [90 0 100]
show polar
[90 0 100]
setpolar [180 45]
; keeps current radius, changes angles only