SilverScreen Solid Modeler

w_to_p

w_to_p

Previous topic Next topic  

w_to_p

Previous topic Next topic JavaScript is required for the print function  

SilverScreenAPI

 

int w_to_p ( SS_XYZ *pt, int *screen_x, int *screen_y )

 

SS_XYZ *pt;           // address of a 3D point

int    *screen_x;     // integer to receive screen x coordinate

int    *screen_y;     // integer to receive screen y coordinate

 

 




Synopsis

#include "silver.h"

 

The w_to_p function computes the screen coordinates (screen_x and screen_y) for a world point pt .

 

 

Parameters

pt is the address of a 3D point structure. screen_x and screen_y are addresses of integers which are to receive the screen coordinates.

 

 

Return Value

w_to_p returns 1if the point is visible in the current window. In this case, screen_x and screen_y are computed. If the point is not visible in the current window, 0 is returned.

 

 

Comments

While related to the function p_to_w , the two are not inverse functions. Calling p_to_w with the results of w_to_p may not return the original point because w_to_p does not preserve any depth information, and may truncate a value when converting to integer space.

 

 

See Also

p_to_w