PickedY.htm 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>PickedY# ( )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. None.
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. Returns the world y coordinate of the most recently executed Pick command. This might have been CameraPick, EntityPick or LinePick. <br />
  21. <br />
  22. The coordinate represents the exact point of where something was picked. <br />
  23. <br />
  24. See also: PickedX, PickedZ.
  25. </td>
  26. </tr>
  27. </table>
  28. <h1><a href=../3d_examples/PickedY.bb>Example</a></h1>
  29. <table>
  30. <tr>
  31. <td>
  32. ; PickedY Example <br />
  33. ; --------------- <br />
  34. <br />
  35. Graphics3D 640,480,0,2 <br />
  36. SetBuffer BackBuffer() <br />
  37. <br />
  38. camera=CreateCamera() <br />
  39. PositionEntity camera,0,2,-10 <br />
  40. <br />
  41. light=CreateLight() <br />
  42. RotateEntity light,90,0,0 <br />
  43. <br />
  44. plane=CreatePlane() <br />
  45. EntityPickMode plane,2 ; Make the plane entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. <br />
  46. ground_tex=LoadTexture("media/Chorme-2.bmp") <br />
  47. EntityTexture plane,ground_tex <br />
  48. <br />
  49. cube=CreateCube() <br />
  50. EntityPickMode cube,2 ; Make the cube entity 'pickable'. Use pick_geometry mode no.2 for polygon collision. <br />
  51. cube_tex=LoadTexture("media/b3dlogo.jpg") <br />
  52. EntityTexture cube,cube_tex <br />
  53. PositionEntity cube,0,1,0 <br />
  54. <br />
  55. While Not KeyDown( 1 ) <br />
  56. <br />
  57. If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0 <br />
  58. If KeyDown( 203 )=True Then TurnEntity camera,0,1,0 <br />
  59. If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05 <br />
  60. If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05 <br />
  61. <br />
  62. ; If left mouse button hit then use CameraPick with mouse coordinates <br />
  63. ; In this example, only three things can be picked: the plane, the cube, or nothing <br />
  64. If MouseHit(1)=True Then CameraPick(camera,MouseX(),MouseY()) <br />
  65. <br />
  66. RenderWorld <br />
  67. <br />
  68. Text 0,0,"Use cursor keys to move about" <br />
  69. Text 0,20,"Press left mouse button to use CameraPick with mouse coordinates" <br />
  70. Text 0,40,"PickedX: "+PickedX#() <br />
  71. Text 0,60,"PickedY: "+PickedY#() <br />
  72. Text 0,80,"PickedZ: "+PickedZ#() <br />
  73. Text 0,100,"PickedNX: "+PickedNX#() <br />
  74. Text 0,120,"PickedNY: "+PickedNY#() <br />
  75. Text 0,140,"PickedNZ: "+PickedNZ#() <br />
  76. Text 0,160,"PickedTime: "+PickedTime#() <br />
  77. Text 0,180,"PickedEntity: "+PickedEntity() <br />
  78. Text 0,200,"PickedSurface: "+PickedSurface() <br />
  79. Text 0,220,"PickedTriangle: "+PickedTriangle() <br />
  80. <br />
  81. Flip <br />
  82. <br />
  83. Wend <br />
  84. <br />
  85. End
  86. </td>
  87. </tr>
  88. </table>
  89. <br>
  90. <a target=_top href=../index.htm>Index</a><br>
  91. <br>
  92. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=PickedY&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  93. </html>