So I'm going to start by saying something outside of the technology.
That is I took the notebook but did not take the mouse. Previous metaphysical experiments have also made this mistake. Left the mouse.
I basically have to drop more than half efficiency.
And then it's on the machine.
So because there is no mouse. I always hesitate to use the touchpad.
And also did not open the teacher teaching ppt ...
Forget to say the question. The topic is simple. Draw a Bezier curve on the book
Then there is the code in the book. But the book is Opengl+dos, and the title is OPENGL+MFC.
So how are the two transformed?
My understanding is that using the WGL series function binds the current PDC and then draws it with the brush PDC in the OnDraw.
But this is not an explicit call to the PDC but is implicitly binding device context pointer
So you finally have to remember to release the PDC ... and then what? If there are some onsize messages that need our
Redraw the words. Then we can also do the processing of this message. But one logic is ....
If the event does not occur: The message will not be sent: We don't have to deal with it without sending it.
But I am in the process of making mistakes. Old thinking about changing it. It must be stupid.
Then with my previous experience of doing engineering above.
I analyzed the structure of the program in the book and copied a piece of code that was specifically drawn to OnDraw
But what about. At this time I used to do before an MFC 3D project to change ...
So I have no control of the previous initialization. In fact, it is. From this step began to collapse.
Then your code will display correctly. To depend on your projection mode: On the display
Requires projection, and we know that there is a very important concept called the viewport. Is the size of the area the user wants to see?
Did you actually think about it at the time?
I have seen this function: Thought it was steady. Who knows it can't perform the function we want:
So, actually, it's missing the function.
So the original 3D project is saying ...
The projection method and the projection parameters are used. So.. There is no 2d,3d keyword ...
When I was doing it, I didn't realize where the 2D to 3D project was sensitive ...
I didn't catch the key place. This was actually the case at the time. If 3D projection mode and parameters are used
Then all your drawing statements will not be error-- But what about. The result is. Nothing is displayed.
Then I saw the result, and the first reaction was to get mad. What do you think of your mistakes?
Leo: Yes. There is one more error in the middle. The exact same function as the book. It's all right in the book. Something happened to me.
And then I panicked. Then clean rebuild confirms that it is not an engineering problem. Found.. I copied the wrong.
Various deletions: Various changes. OnSize all changed. It's stupid.
But it didn't show up later. No idea how to solve it.
Then there was this problem. Even if our posture level is not enough. But we can still get some conclusions.
First of all.. The project has been successfully run up.
That means my drawing statements should not have much of a problem.
So the obvious paradox is that. The drawing statement was executed but the drawing was not visible ...
So one of my thoughts is. The drawing is too thin. The color is the same as the background.
But my subsequent operations ruled out the possibility.
So what do we do? Then I was GG ...
Then we pay attention to this main contradiction again. Painted and not visible. May be caused by what causes
First we have to have a premise. Guaranteed to have been painted.
So there are two questions we don't care about. That's where it's painted. Where did the results show?
So here's a very clear logic. I draw to area A. No Erase action:
I observe the area a again. A area must have a drawing mark (assuming color and size are normal)
So there is no trace of the area we are currently observing. Then explain: Or we're not looking at area A.
Either our drawing operation is indeed incorrect.
But what about. Follow this logic: Do we need to adjust the area? Where to adjust? ViewPort or an avalanche?
That's still not going to work.
So after that we think about it and put it in the first place.
Let's take a closer look at the more fundamental issues. Possible working flow of MFC ...
Draw-Show
So what does this drawing operation mean? We must think of it as a pen, directly on the screen.
The operation of the painting. But if you can draw, why don't you show it? You can still suspect that the zone is not correct.
But we need to know. OpenGL uses the projection matrix. What this means: It has a well-handled matrix
And then project this well-processed matrix into the window area on the screen.
So the process of drawing is to constantly deal with this matrix. The process that is displayed is the projection.
Then the process of drawing is given in the book. But there is no guarantee that the book will be right.
But if our drawing process is correct. We should be suspicious of our display process.
The display process is clearly set in front of the state: Because there is still a lack of knowledge in this area. We can choose to search
What each function means, then I'll simulate the process after the exam.
---glviewport ():
The Glortho function is only responsible for using what kind of scene to intercept the image, and is not responsible for using some sort of rule to render the image on the screen.
Glviewport primarily accomplishes such a function. It is responsible for how the images captured by the scene are displayed to the screen in terms of height and width.
So the last function is a perspective function.
However, we do not have the previous Orth function. Functions related to projection:
So we thought. PPT is how to deal with the MFC two-dimensional engineering?
So in fact we can find a different point in a sudden. But I didn't have a mouse at the time.
So we don't actually open the PPT, we'll just copy the Glortho and we can find
Only part of it is shown: So our natural idea is this viewport? The opening is small.
After the big change,
That's because there's a sign missing here.
Change it to the above.
Results will appear. Done..
Analyze the factors that will affect the results. Take a thought of this factor to
Find out what each function means. Whether you have performed the functions you expect.
If you say. You don't analyze first. Narrow the scope of our concerns. It is difficult for us to directly find the projection function. And the knowledge about Windows is also important.
So if the problem hasn't been solved yet. On the one hand can also reduce the size of the problem. After shrinking to 1. Let's consider expanding the factors that we consider.
So this is a common idea for analyzing engineering problems.
On computer graphics on the computer test avalanche reflection.