Spis poleceń › Movement and Pose — poleceń: 110


anchor

movement and pose

Wejście: none
Wyjście: 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

Wejście: position (list) | vector (list) | length (number) | radius (number)
Wyjście: 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

Wejście: direction (word) | degrees (number) | time (60ths of a second)
Wyjście: 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

Także: bk

movement and pose

Wejście: turtlesteps (number)
Wyjście: none

Cofa bieżącego żółwia o podaną liczbę kroków żółwia.

back 20

barriers

movement and pose

Wejście: none
Wyjście: list

Lists the existing barriers. See setbarriers

show barriers

direction

movement and pose

Wejście: position (list)
Wyjście: 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

Wejście: position (list) | position (list)
Wyjście: distance (number)

Zwraca odległość od pierwszego zestawu współrzędnych do drugiego. distance przyjmuje listę [X Y Z] albo listę [X Y], przyjmując Z równe 0

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

divergence

movement and pose

Wejście: [vector1 vector2] (list) | [vector3 vector4] (list)
Wyjście: 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

Także: dn

movement and pose

Wejście: degrees (number)
Wyjście: none

Opuszcza nos wywołującego żółwia o podaną liczbę stopni. Zobacz up

down 45

drift

movement and pose

Wejście: steps vector
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: position (list) | vectors (list) | [left right forward backward above below] (list)
Wyjście: 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

Wejście: position (list) | vector (list) | distance (number)
Wyjście: 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

Wejście: position (list of 3) | position (list of 3)
Wyjście: 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

Wejście: co-ordinates (list) | degrees (number)
Wyjście: 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

Wejście: none
Wyjście: none

Zatrzymuje wywołującego żółwia, gdy dotrze do granic ekranu ustawionych przez setbounds. Zobacz setbounds, bounds, window, wrap, hitboundsp

fence

fixate

Także: fix

movement and pose

Wejście: position
Wyjście: 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

Także: fd

movement and pose

Wejście: turtle-spaces (number)
Wyjście: none

Przesuwa żółwia do przodu o podaną liczbę kroków żółwia. Rysuje linię, jeśli pisak jest opuszczony. Zobacz pendown, back

forward 20

forwarddir

movement and pose

Wejście: none
Wyjście: vector (list)

Returns the calling turtle's forward vector. See backdir

show forwarddir

backdir

movement and pose

Wejście: none
Wyjście: vector (list)

Returns the calling turtle's back vector. See forwarddir

show backdir

heading

Także: hd

movement and pose

Wejście: none
Wyjście: degrees

Zwraca kurs (oś x) wybranego żółwia w stopniach. Kurs jest skumulowaną wartością względną, która sama w sobie nie pozwala wiernie odtworzyć orientacji, gdy żółw porusza się w trzech wymiarach; do tego służą orientation / setorientation. Zobacz pitch i roll

print heading

home

movement and pose

Wejście: none
Wyjście: none

Sprowadza aktualnie wybranego żółwia do pozycji domowej.

home

inside

movement and pose

Wejście: [[x1 y1 z1] [x2 y2 z2]]
Wyjście: 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

Wejście: steps (number)
Wyjście: none

Przesuwa żółwia do przodu o podaną liczbę kroków żółwia bez rysowania, niezależnie od stanu pisaka.

jump 20

left

Także: lt

movement and pose

Wejście: degrees
Wyjście: none

Obraca wybranego żółwia w lewo o podaną liczbę stopni. Zobacz right

left 90
lt 45

leftarc

Także: larc

movement and pose

Wejście: degrees or [degrees segments] | radius
Wyjście: none

Tworzy łuk do przodu i w lewo od pozycji żółwia, umieszczając go na jego końcu. W trybie wrap łuki nie przechodzą przez krawędzie w sposób czysty. Jeśli pierwszy parametr podano jako listę, pierwsza wartość to stopnie, a druga to liczba segmentów łuku, która zastępuje wewnętrzny algorytm obliczania liczby segmentów. Zobacz rightarc

leftarc 90 40

location

movement and pose

Wejście: co-ordinates (list)
Wyjście: 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

Także: lo

movement and pose

Wejście: turtle-units
Wyjście: none

Obniża żółwia (cofa go wzdłuż jego wektora w górę). To samo co down 90 forward turtle-units up 90. Na przykład Myrtle w pozycji domowej po uruchomieniu turtleSpaces oddali się od żółwia kamery Snappy, jeśli ją obniżysz. Zobacz raise

lower 100

move

movement and pose

Wejście: distance (turtle-units) | degrees OR [degrees degrees] OR [[vector]]
Wyjście: none

Przesuwa żółwia w podanym kierunku o podaną liczbę jednostek żółwia, nie zmieniając jego orientacji ani wektorów. Jeśli podano listę dwóch wartości, przesuwa go najpierw w poziomie (pierwsza wartość), a potem w pionie (druga wartość).

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

near

movement and pose

Wejście: position (list) | radius (number) OR [radius group] (list)
Wyjście: 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

Wejście: distance (number) OR [distance group] (list)
Wyjście: 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

Wejście: none
Wyjście: none

Turns off any existing autoorbit. See autoorbit.

noautoorbit

nostealth

movement and pose

Wejście: none
Wyjście: none

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

nostealth

notether

movement and pose

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: turtle-units (number)

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

show orbitdistance

orbitdown

Także: odn

movement and pose

Wejście: degrees (number)
Wyjście: none

Obraca żółwia po orbicie od dołu wokół jego punktu zaczepienia o podaną liczbę stopni. Uwaga: przy wyłączonym fluid żółw przechodzi wprost do celu, a jeśli pisak jest opuszczony, między początkiem a celem rysowana jest linia bez punktów pośrednich. Zobacz setanchor, dropanchor

orbitdown 90

orbitleft

Także: olt

movement and pose

Wejście: degrees (number)
Wyjście: none

Obraca żółwia w lewo po orbicie wokół jego punktu zaczepienia o podaną liczbę stopni. Uwaga: przy wyłączonym fluid żółw przechodzi wprost do celu, a jeśli pisak jest opuszczony, między początkiem a celem rysowana jest linia bez punktów pośrednich. Zobacz setanchor, dropanchor

orbitleft 90

orbitright

Także: ort

movement and pose

Wejście: degrees (number)
Wyjście: none

Obraca żółwia w prawo po orbicie wokół jego punktu zaczepienia o podaną liczbę stopni. Uwaga: przy wyłączonym fluid żółw przechodzi wprost do celu, a jeśli pisak jest opuszczony, między początkiem a celem rysowana jest linia bez punktów pośrednich. Zobacz setanchor, dropanchor


orbitup

Także: oup

movement and pose

Wejście: degrees (number)
Wyjście: none

Obraca żółwia po orbicie od góry wokół jego punktu zaczepienia o podaną liczbę stopni. Uwaga: przy wyłączonym fluid żółw przechodzi wprost do celu, a jeśli pisak jest opuszczony, między początkiem a celem rysowana jest linia bez punktów pośrednich. Zobacz setanchor, dropanchor

orbitup 90

orbitvector

movement and pose

Wejście: vector (list) | degrees (number)
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: list

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

show origin
[0 0 0]

originvectors

movement and pose

Wejście: none
Wyjście: list

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

show originvectors

pitch

Także: pt

movement and pose

Wejście: none
Wyjście: pitch (number)

Zwraca pochylenie bieżącego żółwia

print pitch

pos

movement and pose

Wejście: none
Wyjście: [x y] (list)

Zwraca współrzędne x i y żółwia. Aby otrzymać wszystkie trzy wymiary, zobacz position

show pos

position

movement and pose

Wejście: none
Wyjście: [x y z] (list)

Zwraca współrzędne żółwia. Aby otrzymać tylko dwa pierwsze wymiary, zobacz pos

show position

project

movement and pose

Wejście: [x% y% (Z)] (list)
Wyjście: 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

Także: pui

movement and pose

Wejście: turtle-spaces (number)
Wyjście: none

Przyciąga wywołującego żółwia ku jego punktowi zaczepienia o podaną liczbę przestrzeni żółwia. Zatrzymuje się po dotarciu do punktu zaczepienia.

pullin 40

pullout

Także: puo

movement and pose

Wejście: turtle-spaces (number)
Wyjście: none

Odsuwa wywołującego żółwia od jego punktu zaczepienia o podaną liczbę przestrzeni żółwia.

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

raise

Także: ra

movement and pose

Wejście: turtle-units (number)
Wyjście: none

Podnosi aktualnie wybranego żółwia o podaną liczbę jednostek żółwia. Rysuje linię, jeśli pisak jest opuszczony. Zobacz lower

raise 20

randomheading

Także: randhead

movement and pose

Wejście: none
Wyjście: none

Ustawia żółwia w losowym kierunku.

randomheading

randomposition

Także: randpos

movement and pose

Wejście: none
Wyjście: none

Umieszcza żółwia w losowym miejscu w obrębie bieżących granic, na bieżącej płaszczyźnie Z. Zobacz bounds

randomposition

randomvectors

Także: randvec

movement and pose

Wejście: none
Wyjście: 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

Wejście: [x y z] (list)
Wyjście: [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

Także: rt

movement and pose

Wejście: degrees
Wyjście: none

Obraca wybranego żółwia w prawo o podaną liczbę stopni. Jeśli liczba stopni jest ujemna, obraca go w lewo. Zobacz left

right 90

rightarc

Także: rarc

movement and pose

Wejście: degrees or [degrees segments] | radius
Wyjście: none

Tworzy łuk do przodu i w prawo od pozycji żółwia, umieszczając go na jego końcu. W trybie wrap łuki nie przechodzą przez krawędzie dokładnie. Jeśli pierwszy parametr podano jako listę, drugi element listy określa liczbę segmentów użytych do zbudowania łuku. Zobacz leftarc

rightarc 90 40

rightdir

movement and pose

Wejście: none
Wyjście: vector

Returns the right vector of the selected turtle. See leftdir

show rightdir

leftdir

movement and pose

Wejście: none
Wyjście: vector

Returns the left vector of the selected turtle. See rightdir

show leftdir

roll

Także: ro

movement and pose

Wejście: none
Wyjście: number

Zwraca bieżącą wartość przechylenia. Zobacz setroll

show roll

rollleft

Także: rl

movement and pose

Wejście: degrees (number)
Wyjście: none

Przechyla aktualnie wybranego żółwia w lewo o podaną liczbę stopni.

rollleft 90

rollright

Także: rr

movement and pose

Wejście: degrees (number)
Wyjście: none

Przechyla aktualnie wybranego żółwia w prawo o podaną liczbę stopni.

rollright 45

setanchor

movement and pose

Wejście: position (list) [X Y (Z)]
Wyjście: 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

Wejście: [[[x1 y1 z1][x2 y2 z2]][[x3 y3 z3][x4 y4 z4]]…] (list of lists)
Wyjście: 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

Także: sbds

movement and pose

Wejście: x1 y1 x2 y2 (list) OR [[x1 y1 z1][x2 y2 z2]] (list of lists) OR radius
Wyjście: none

Ustawia granice używane przez wrap i fence. Jeśli podano jedną wartość, granicą jest promień okręgu lub kuli o środku w bieżącym punkcie origin. Jeśli ta jedna wartość jest ujemna, granicą jest półkula oparta na Z, czyli żółw nie może wejść w ujemne wartości Z. Jeśli nie podano wartości Z, przyjmują one -1000 / 1000. Domyślne granice to [[-212 -119 100] [212 119 100]] w formacie [[x1 y1 z1] [x2 y2 z2]], co daje domyślny obszar wyświetlania o szerokości 424, wysokości 238 i głębokości 200 jednostek żółwia. Zobacz bounds, fence, wrap

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

setheading

Także: seth shd

movement and pose

Wejście: degrees (number)
Wyjście: none

Ustawia kurs żółwia (lewo-prawo) i odpowiednio aktualizuje jego orientację. Uwaga: setheading zmienia wprawdzie wartość kursu na potrzeby orientacji, ale użyte samodzielnie może sprawić, że setorientation nie przywróci oczekiwanej orientacji. Jeśli zamierzasz przywracać orientację żółwia za pomocą setorientation, używaj setorientation także do zmiany poszczególnych jej elementów. Zobacz orientation

setheading 90

setorbitdistance

movement and pose

Wejście: turtle-units (number)
Wyjście: none

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

setorbitdistance 100

setorientation

movement and pose

Wejście: vectors (list)
Wyjście: 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

Wejście: order (word)
Wyjście: 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

Wejście: [x y z] (list)
Wyjście: 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

Wejście: vectors (list)
Wyjście: 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

Także: setp spi

movement and pose

Wejście: degrees (number)
Wyjście: 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

Także: setpos spo

movement and pose

Wejście: [x y (z)] (list) OR [[x1 y1 z1] [x2 y2 z2]…]
Wyjście: none

Ustawia współrzędne żółwia. Jeśli pisak jest opuszczony, między starą a nową pozycją rysowana jest linia. Jeśli setposition otrzyma listę list, rysuje linie łączące te punkty (przy opuszczonym pisaku), a żółw pozostaje w ostatniej podanej pozycji.

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

setroll

Także: setr sro

movement and pose

Wejście: degrees (number)
Wyjście: 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

Wejście: [[forwarddir] [updir] [rightdir]] (list of lists)
Wyjście: none

Ustawia orientację bieżącego żółwia za pomocą wektorów.

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

setx

movement and pose

Wejście: number
Wyjście: none

Ustawia pozycję x żółwia.

setx 100

setxy

movement and pose

Wejście: x (number) | y (number)
Wyjście: 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

Wejście: number
Wyjście: none

Ustawia pozycję y żółwia.

sety 20

setz

movement and pose

Wejście: number
Wyjście: none

Ustawia pozycję z żółwia.

setz 50

showme

movement and pose

Wejście: turtle
Wyjście: 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

Także: sl

movement and pose

Wejście: turtle-steps
Wyjście: none

Przesuwa żółwia w bok, w lewo, o podaną liczbę kroków żółwia.

slideleft 20

slideright

Także: sr

movement and pose

Wejście: turtle-steps
Wyjście: none

Przesuwa żółwia w bok, w prawo, o podaną liczbę kroków żółwia.

slideright 30

spin

movement and pose

Wejście: [vectors] (list) | degrees
Wyjście: none

Obraca żółwia wokół podanego wektora o podaną liczbę stopni, zgodnie z ruchem wskazówek zegara patrząc zza wektora, tak że SPIN FORWARDDIR 90 działa tak samo jak ROLLRIGHT 90. Nie wpływa na pochylenie, kurs ani przechylenie.

spin forwarddir 90

stealth

movement and pose

Wejście: none
Wyjście: none

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

stealth

tether

movement and pose

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: [x y] (list)
Wyjście: heading (number)

Zwraca kurs, przy którym żółw byłby skierowany ku podanym współrzędnym. towards zakłada, że współrzędna docelowa leży na tej samej płaszczyźnie Z co żółw. towards to prymityw odziedziczony po Apple Logo, przydatny w turtleSpaces dla zgodności i w zastosowaniach dwuwymiarowych. Zobacz heading

setheading towards [30 40]

up

movement and pose

Wejście: degrees
Wyjście: none

Unosi nos żółwia o podaną liczbę stopni. Patrząc na żółwia z góry (widok domyślny), up 90 sprawia, że żółw skieruje się prosto ku tobie.

up 90

updir

movement and pose

Wejście: none
Wyjście: vector (list)

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

show updir

downdir

movement and pose

Wejście: none
Wyjście: vector (list)

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

show downdir

unproject

movement and pose

Wejście: position (list)
Wyjście: [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

Wejście: none
Wyjście: [forwarddir updir rightdir]

Zwraca wektory orientacji żółwia w postaci listy. To najpewniejszy sposób zapisywania i przywracania orientacji żółwia, w odróżnieniu od funkcji orientation, która zwraca względne wartości kursu, pochylenia i przechylenia.

print vectors

xpos

Także: xcor

movement and pose

Wejście: none
Wyjście: xpos (number)

Zwraca bieżącą współrzędną x żółwia.

show xpos

ypos

Także: ycor

movement and pose

Wejście: none
Wyjście: ypos (number)

Zwraca bieżącą współrzędną y żółwia.

show ypos

zpos

Także: zcor

movement and pose

Wejście: none
Wyjście: zpos (number)

Zwraca bieżącą współrzędną z żółwia.

show zpos

zeroheading

movement and pose

Wejście: none
Wyjście: none

Zeruje wartość kursu żółwia. Nie zmienia to jego rzeczywistej orientacji; kolejne zmiany będą normalnie aktualizować kurs. Ten prymityw pozwala wyznaczyć nowy kurs odniesienia, od którego można pracować dalej. Zobacz heading

zeroheading

zeroorientation

movement and pose

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: 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

Wejście: none
Wyjście: number

Skrócona forma xpos. Zwraca współrzędną X żółwia.

print xcor

ycor

movement and pose

Wejście: none
Wyjście: number

Skrócona forma ypos. Zwraca współrzędną Y żółwia.

print ycor

zcor

movement and pose

Wejście: none
Wyjście: number

Skrócona forma zpos. Zwraca współrzędną Z żółwia.

print zcor

polar

movement and pose

Wejście: none
Wyjście: 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

Wejście: [azimuth elevation (radius)]
Wyjście: 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