|
This function converts a given line in the 3D world to its projection on the rendered window.
This could be very useful when drawing a wire frame to a polygon.
Parameters:
p1, p2 : A line (a segment) in the 3D world
p1_2D, p2_2D : The equivalent line on the rendered window.
Return value:
returns one of the four:
EDGE_NOT_SEEN if the edge is outside the rendering window
in this case p1_2D and p2_2D are not valid
EDGE_FULLY_SEEN if the edge is fully inside the rendering window
in this case p1_2D and p2_2D are the desired result
EDGE_PARTIALLY_SEEN if some of the edge is inside the window
in this case p1_2D and p2_2D are the portion that inside the rendering area
VR_ERROR an error occurred
in this case p1_2D and p2_2D are not valid
Example:
double p1[3]={10,20,30};
double p2[3]={100,200,300};
double p1_2d[3], p2_2d[3];
inr rc;
rc=STATE_engine_3D_edge_to_2D(p1,p2, p1_2d, p2_2d);
|