|
Pseudocode:
// in deed you must need normal transition to change
// but i did not know !!
while (some express) {
pos_x_projected [index] = x [index] / z [index];
pos_y_projected [index] = y [inedx] / z [index];
index ++;
}
// world Cartesian coordinate and viewport to windows in Windows coordinate
// i give you some formula, some stupid don't understand
(w_pos_x-WINDOWS_CDC_LEFT) / (WINDOWS_CDC_RIGHT-WINDOWS_CDC_LEFT) = (pos_x_projected-VIEWPORT_LEFT) / (VIEWPORT_RIGHT-VIEWPORT_LEFT);
(w_pos_y-WINDOWS_CDC_TOP) / (WINDOWS_CDC_BOTTOM-WINDOWS_CDC_TOP) = (pos_x_projected-VIEWPORT_BOTTOM) / (VIEWPORT_TOP-VIEWPORT_BOTTOM);
// compute the w_pos_x and w_pos_y
// but i don't where's viewport in camera ??? !! 1
// get DC of windows
while (some express) {
dc.LineTo (w_pos_x [index], w_pos_y [index])
// some other process to draw a whole primary
}
Because we don't know the initial position of the primitives, we don't know where the camera is, and we don't know whether to crop, so this pipeline is hard to make mistakes! !! Only when it (x [], y [], x []) are already in the transformed position, but it is unlikely to exist in the actual situation! !! !! Please do n’t push the law in the future, this way you ca n’t get a foothold in verysource! |
|