Files
BlitzNext/_release/help/commands/3d_commands/TFormPoint.htm
T
2014-12-08 12:43:20 +13:00

71 lines
2.0 KiB
HTML

<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>TFormPoint x#, y#, z#, source_entity, dest_entity</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
x#, y#, z# = coordinates of a point in 3d space
<br />
<br />
source_entity = handle of source entity, or 0 for 3d world
<br />
dest_entity = handle of destination entity, or 0 for 3d world
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
Transforms between coordinate systems. After using TFormPoint the new
<br />
coordinates can be read with TFormedX(), TFormedY() and TFormedZ().
<br />
<br />
<br />
See EntityX() for details about local coordinates.
<br />
<br />
Consider a sphere built with CreateSphere(). The 'north pole' is at (0,1,0).
<br />
At first, local and global coordinates are the same. As the sphere is moved,
<br />
turned and scaled the global coordinates of the point change.
<br />
<br />
But it is always at (0,1,0) in the sphere's local space.
</td>
</tr>
</table>
<h1><a href=../3d_examples/TFormPoint.bb>Example</a></h1>
<table>
<tr>
<td>
; TFormPoint example
<br />
<br />
Graphics3D 640, 480
<br />
<br />
s = CreateSphere() ; center at (0,0,0) north pole at (0,1,0)
<br />
<br />
MoveEntity s, 1,2,3 ; center at (1,2,3) north pole at (1,2+1,3)
<br />
ScaleEntity s, 10,10,10 ; center at (1,2,3) north pole at (1,2+10,3)
<br />
<br />
; Now verify that the north pole is at (1,12,3) in the 3d world
<br />
<br />
TFormPoint 0,1,0, s,0 ; north pole transformed from sphere to world
<br />
<br />
message$ = "North pole is at ( "
<br />
message = message + TFormedX() + ", " + TFormedY() + ", " + TFormedZ() + " )"
<br />
<br />
Text 180, 200, message
<br />
<br />
Flip
<br />
<br />
WaitKey()
<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=TFormPoint&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
</html>