94 lines
2.8 KiB
HTML
94 lines
2.8 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>PickedZ# ( )</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
None.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
Returns the world z coordinate of the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
The coordinate represents the exact point of where something was picked.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
See also: PickedX, PickedY.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../3d_examples/PickedZ.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; PickedZ Example
|
|
<br />
|
|
; ---------------
|
|
<br />
|
|
|
|
<br />
|
|
Graphics3D 640,480,0,2
|
|
<br />
|
|
SetBuffer BackBuffer()
|
|
<br />
|
|
|
|
<br />
|
|
camera=CreateCamera()
|
|
<br />
|
|
PositionEntity camera,0,2,-10
|
|
<br />
|
|
|
|
<br />
|
|
light=CreateLight()
|
|
<br />
|
|
RotateEntity light,90,0,0
|
|
<br />
|
|
|
|
<br />
|
|
plane=CreatePlane()
|
|
<br />
|
|
EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
|
|
<br />
|
|
ground_tex=LoadTexture("media/Chorme-2.bmp")
|
|
<br />
|
|
EntityTexture plane,ground_tex
|
|
<br />
|
|
|
|
<br />
|
|
cube=CreateCube()
|
|
<br />
|
|
EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision.
|
|
<br />
|
|
cube_tex=LoadTexture("media/b3dlogo.jpg")
|
|
<br />
|
|
EntityTexture cube,cube_tex
|
|
<br />
|
|
PositionEntity cube,0,1,0
|
|
<br />
|
|
|
|
<br />
|
|
While Not KeyDown( 1 )
|
|
<br />
|
|
|
|
<br />
|
|
If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
|
|
<br />
|
|
If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
|
|
<br />
|
|
If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
|
|
<br />
|
|
If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
|
|
<br />
|
|
|
|
<br />
|
|
; If left mouse button hit then use CameraPick with mouse coordinates
|
|
<br />
|
|
; In this example, only three things can be picked: the plane, the cube, or nothing
|
|
<br />
|
|
If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY())
|
|
<br />
|
|
|
|
<br />
|
|
RenderWorld
|
|
<br />
|
|
|
|
<br />
|
|
Text 0,0,"Use cursor keys to move about"
|
|
<br />
|
|
Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates"
|
|
<br />
|
|
Text 0,40,"PickedX: "+PickedX#()
|
|
<br />
|
|
Text 0,60,"PickedY: "+PickedY#()
|
|
<br />
|
|
Text 0,80,"PickedZ: "+PickedZ#()
|
|
<br />
|
|
Text 0,100,"PickedNX: "+PickedNX#()
|
|
<br />
|
|
Text 0,120,"PickedNY: "+PickedNY#()
|
|
<br />
|
|
Text 0,140,"PickedNZ: "+PickedNZ#()
|
|
<br />
|
|
Text 0,160,"PickedTime: "+PickedTime#()
|
|
<br />
|
|
Text 0,180,"PickedEntity: "+PickedEntity()
|
|
<br />
|
|
Text 0,200,"PickedSurface: "+PickedSurface()
|
|
<br />
|
|
Text 0,220,"PickedTriangle: "+PickedTriangle()
|
|
<br />
|
|
|
|
<br />
|
|
Flip
|
|
<br />
|
|
|
|
<br />
|
|
Wend
|
|
<br />
|
|
|
|
<br />
|
|
End
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<a target=_top href=../index.htm>Index</a><br>
|
|
<br>
|
|
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=PickedZ&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|