x#, y#, z# = coordinates of a point in 3d space source_entity = handle of source entity, or 0 for 3d world dest_entity = handle of destination entity, or 0 for 3d world |
Transforms between coordinate systems. After using dxTFormPoint the new coordinates can be read with dxTFormedX(), dxTFormedY() and dxTFormedZ(). See dxEntityX() for details about local coordinates. Consider a sphere built with dxCreateSphere(). The 'north pole' is at (0,1,0). At first, local and global coordinates are the same. As the sphere is moved, turned and scaled the global coordinates of the point change. But it is always at (0,1,0) in the sphere's local space. |
; dxTFormPoint example dxGraphics3D 640, 480 s = dxCreateSphere() ; center at (0,0,0) north pole at (0,1,0) dxMoveEntity s, 1,2,3 ; center at (1,2,3) north pole at (1,2+1,3) dxScaleEntity s, 10,10,10 ; center at (1,2,3) north pole at (1,2+10,3) ; Now verify that the north pole is at (1,12,3) in the 3d world dxTFormPoint 0,1,0, s,0 ; north pole transformed from sphere to world message$ = "North pole is at ( " message = message + dxTFormedX() + ", " + dxTFormedY() + ", " + dxTFormedZ() + " )" dxText 180, 200, message dxFlip dxWaitKey() End |