I read about there is a eye coordinate frame in opengl superbile,what the differece between it and world corrdinate frame,superbible said eye coordinate frame is fixed,never be transformed,then what do the viewing transformation do?Dont it transform the eye coordinate frame since the eye coordinate frame is used to choose a vantage point?
If that’s what the book says, that’s not very good wording.
I wouldn’t think of anything as “fixed”. It all depends on your perspective. Just realize there are different coordinate spaces, and the transforms take you between those coordinate spaces.
OBJECT SPACE --(Modeling)–> WORLD SPACE --(Viewing)–> EYE SPACE --(Projection)–> CLIP SPACE
The idea with OBJECT SPACE and WORLD SPACE is that OBJECT SPACE is some coordinate system local to each object or group of objects (say, where each object like say a house or a tree is modeled at the origin). But WORLD SPACE is a space where they are all positioned and oriented in the same space relative to each other properly (look around you in your room; that’s world space).
When starting out, you can just designate OBJECT SPACE to be the same as WORLD SPACE (i.e. use the identity matrix for the Modeling transform). But as you progress, you quickly see the advantage for having OBJECT and WORLD space being different.
For instance, envision having one “tree” object drawn planted at the origin. And now you’d like to draw 100 trees, all spaced on the ground properly relative to each other. Time for: the Modeling transform!
I think the term fixed merely refers to the fact that no matter which transform you do, the virtual camera is thought of to be stationary at the origin and looking down the negative z-axis.
Like Dark Photon mentioned, every vertex undergoes a series of transformations before being mapped to the screen and it’s a matter of taste how to picture the effects they have on the contents of the virtual world.
Imagine you carry a camera phone around and shoot a little movie. If you move the camera, the movement is of courese reflected in the film because you swing the phone around. But you could also have the phone in you hand and stand still and move all the objects around to create the same effect. In this case, the camera would be fixed and everything else would be moving - and that’s just what’s simulated in OpenGL and 3D graphics in general. The difference is that you’re not dragging real objects around but mathematically rotate and move vertices.