When you say something like "It can be clipped to the top of the screen" what does this mean? Lets just say we're talking about ohh a windows bitmap file or something.
When you say something like "It can be clipped to the top of the screen" what does this mean? Lets just say we're talking about ohh a windows bitmap file or something.
Well lets assume your screen is 800x600 ok? You have a bitmap thats 100x100 ( all in pixels ). Lets say you start your bitmap off at 600 or something near the bottom of the screen. Then every frame when you call Blt to draw it to the window, you subtract a pixel from the top. Well this bitmap will be moving upwards right? What happens when the top of the bitmap is -1? Thats out of bounds and Blt will fail. This will make the bitmap disappear at the top of the screen. You clip so that it gives the illusion of sliding completely off of the window. Basically, you see how much past the top it is ( in this case 1 pixel ) then you just add a pixel to the bitmap's top so that it doesn't show the top line of the bmp and it'll give the illusion of smoothly going off of the screen. Thats one example of 2D clipping.
Just a couple of questions: is it true that Y is actually downwards in the windows screen coordinates? I remember doing a console application a while ago using setconsolepos functions (or something) and increasing the y made the characters move DOWN. Or maybe I was standing on my head and forgot to realize it
The standardized cartesian(at least i think its cartesian, my math is rusty) co-ordinate system is adapted to the screen as:
0-------------------------------------------+X
|
|
|
|
|
|
|
|
|
|
|
|
+
Y
( Zero being top left corner )
c++->visualc++->directx->opengl->c++;
(it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)
don't forget the Z axis.....and yes you are correct about the name of the coord system.
Then I do believe it is:
0--------------------------------------------------+X
|\
|..\
|....\
|......\
|........\
|.........+
|...........Z( Z: buffer [d3d]) ?
|
|
|
|
|
|
|
+
y
I think its the depth buffer your talking about, either way, z is positive INTO the screen.
c++->visualc++->directx->opengl->c++;
(it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)
yes i am referring to the depth buffer.
Um, actually it depends on if you setup your application to use a Left-Handed or Right-Handed coordinate system. Its completely arbitrary and up to personal preference. I always use Left-Handed myself because that is the Direct3D default. The OpenGL default is Right-Handed if I remember correctly. The difference in coordinate systems is which way the positive Z-Axis points.Originally posted by dbgt goten
either way, z is positive INTO the screen.
By default in opengl the Z axis is positive into the screen.
Ive always read that OpenGL uses a right handed system...which would be positive out of the screen.