Hilfe
LinePick
Aufruf
Parameter
Rückgabewert
Beschreibung
Beispiel
Siehe auch
entity% = LinePick (x#, y#, z#, dx#, dy#, dz# [, radius#])
Parameter
x# | X-Koordinate des Startpunkts |
y# | Y-Koordinate des Startpunkts |
z# | Z-Koordinate des Startpunkts |
dx# | X-Abstand der Linie (Delta) |
dy# | Y-Abstand der Linie (Delta) |
dz# | Z-Abstand der Linie (Delta) |
radius# | Radius der Linie (Standard=0) |
Rückgabewert
Identität des ersten Objekts vom Startpunkt zum Endpunkt.
Beschreibung
Die Anweisung LinePick ermittelt die Identität des ersten Objekts, welches eine Linie vom Startpunkt zum Endpunkt berührt.
Der Startpunkt der Linie befindet sich an Position x#,y#,z#
Die Abstände der Linie sind dx#, dy# und dz#.
Der Radius einer Linie kann auch eingestellt werden (vergleichbar mit Durchmesser eines Rohrs).
Ein Entity muss mit EntityPickMode
auf einen größeren Wert als Null gesetzt werden, damit diese Funktion korrekt arbeitet.

Beispiel
Standardbeispiel:
Graphics3D 640, 480
SetBuffer BackBuffer()
camera = CreateCamera()
MoveEntity camera, - 5, 0, 10
TurnEntity camera, 0, - 90, 0
light = CreateLight()
sphere = CreateSphere(32)
EntityPickMode sphere, 1
PositionEntity sphere, 0, 0, 10
cylinder = CreateCylinder(32)
TurnEntity cylinder, 90, 0, 0
ScaleEntity cylinder, .5, 1000, .5
PositionEntity cylinder, 0, 0, 10
While Not KeyDown(1)
If KeyDown(208) = 1 Then MoveEntity sphere, 0, - .01, 0
If KeyDown(200) = 1 Then MoveEntity sphere, 0, .01, 0
If KeyDown(203) = 1 Then MoveEntity sphere, - .01, 0, 0
If KeyDown(205) = 1 Then MoveEntity sphere, .01, 0, 0
UpdateWorld
RenderWorld
Text 0, 0, LinePick(0, 0, 0, 0, 0, 20, .5)
Flip
Wend
End
SetBuffer BackBuffer()
camera = CreateCamera()
MoveEntity camera, - 5, 0, 10
TurnEntity camera, 0, - 90, 0
light = CreateLight()
sphere = CreateSphere(32)
EntityPickMode sphere, 1
PositionEntity sphere, 0, 0, 10
cylinder = CreateCylinder(32)
TurnEntity cylinder, 90, 0, 0
ScaleEntity cylinder, .5, 1000, .5
PositionEntity cylinder, 0, 0, 10
While Not KeyDown(1)
If KeyDown(208) = 1 Then MoveEntity sphere, 0, - .01, 0
If KeyDown(200) = 1 Then MoveEntity sphere, 0, .01, 0
If KeyDown(203) = 1 Then MoveEntity sphere, - .01, 0, 0
If KeyDown(205) = 1 Then MoveEntity sphere, .01, 0, 0
UpdateWorld
RenderWorld
Text 0, 0, LinePick(0, 0, 0, 0, 0, 20, .5)
Flip
Wend
End
Siehe auch
CameraPick, EntityPickMode, PickedX, PickedY, PickedZ, PickedNX, PickedNY, PickedNZ, EntityPick, PickedEntity, PickedSurface, PickedTime, PickedTriangle

