My question is quite basic in computer graphics field, but somehow I couldn't find an answer.
Prolog:
I want to write a program which prints polygons on a canvas, and I'd like to allow users to play with the polygons - scale, translate and rotate (around x/y/z axis).
I ought to use java AWT only; not JOGL (java's library for openGL).
I recieve the polygons as 3d world coordinates as via input file to the program, as well as "camera" properties such as coordinates of camera, look at point, up vector and a window size (used in the projection from 3d to 2d).
First question:
My first problem is to write the viewing pipeline, so the 3d world coordinats would convert to viewing coordinates (camera coordinates), then project it onto 2d coordinates and perform a clipping to create the perspective. I've seen countless videos and methods but I can't decide on the final matrices.
Second question:
My second problem is, where to apply the 3D transformation matrices. Should the transformations be applied on the original world coordinates (and then of course continue with the viewing pipeline) or directly to view coordinates (and continue the pipeline from that point)?
For clarification, let's denote viewing pipeline as A->B->C->D, which is re-calculated on each user transformation, and a user initiated transformation (could be any of the above) as T.
My concern is whether to do TA->B->C->D or A->TB->C->D.
Thanks for helpers.