TFormPoint.htm 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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>TFormPoint x#, y#, z#, source_entity, dest_entity</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. x#, y#, z# = coordinates of a point in 3d space <br />
  13. <br />
  14. source_entity = handle of source entity, or 0 for 3d world <br />
  15. dest_entity = handle of destination entity, or 0 for 3d world
  16. </td>
  17. </tr>
  18. </table>
  19. <h1>Description</h1>
  20. <table>
  21. <tr>
  22. <td>
  23. Transforms between coordinate systems. After using TFormPoint the new <br />
  24. coordinates can be read with TFormedX(), TFormedY() and TFormedZ(). <br />
  25. <br />
  26. <br />
  27. See EntityX() for details about local coordinates. <br />
  28. <br />
  29. Consider a sphere built with CreateSphere(). The 'north pole' is at (0,1,0). <br />
  30. At first, local and global coordinates are the same. As the sphere is moved, <br />
  31. turned and scaled the global coordinates of the point change. <br />
  32. <br />
  33. But it is always at (0,1,0) in the sphere's local space.
  34. </td>
  35. </tr>
  36. </table>
  37. <h1><a href=../3d_examples/TFormPoint.bb>Example</a></h1>
  38. <table>
  39. <tr>
  40. <td>
  41. ; TFormPoint example <br />
  42. <br />
  43. Graphics3D 640, 480 <br />
  44. <br />
  45. s = CreateSphere() ; center at (0,0,0) north pole at (0,1,0) <br />
  46. <br />
  47. MoveEntity s, 1,2,3 ; center at (1,2,3) north pole at (1,2+1,3) <br />
  48. ScaleEntity s, 10,10,10 ; center at (1,2,3) north pole at (1,2+10,3) <br />
  49. <br />
  50. ; Now verify that the north pole is at (1,12,3) in the 3d world <br />
  51. <br />
  52. TFormPoint 0,1,0, s,0 ; north pole transformed from sphere to world <br />
  53. <br />
  54. message$ = "North pole is at ( " <br />
  55. message = message + TFormedX() + ", " + TFormedY() + ", " + TFormedZ() + " )" <br />
  56. <br />
  57. Text 180, 200, message <br />
  58. <br />
  59. Flip <br />
  60. <br />
  61. WaitKey() <br />
  62. End
  63. </td>
  64. </tr>
  65. </table>
  66. <br>
  67. <a target=_top href=../index.htm>Index</a><br>
  68. <br>
  69. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=TFormPoint&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  70. </html>