davidktw
Arch-Supremacy Member
- Joined
- Apr 15, 2010
- Messages
- 13,549
- Reaction score
- 1,302
so i just need to remove one of them
I am not answering this. Please test things out and read up on this function.
so i just need to remove one of them
What is the most common reason for windows freezings?
I am trying to render the program..
Define windows freezing. Your application window freeze or the whole Windows OS freeze ?
If you observe high CPU, then it's probably an infinite loop somewhere.
The GLUT also have it's own set of loop for capturing windows event. It's in the same main thread as the rest of the code running. Like I said, it's an event driven application like all Windows GUI application. If you have an intensive job, use a separate thread to do it.
Add On:
BTW what is the objective of your work ? Is it assignments that has to be completed in C, FYP or any such academic assignments ?
It seems to be you have a rather lacking knowledge with development in C. If it's just OpenGL, perhaps you will feel more comfortable using JOGL, so that you can better focus on the problem at hand rather than struggling over how to develop properly in C ?
i need to finish in C,must be opengl.
the application window freezes
the assignment is a meshviewer
Okay, did you observe a high cpu of near 100% when your application window freezes ? If not, it might not be freezer, but rather not responding or perhaps it could be your codes are not performing anything for the screen to change.
i am on my way to debug,it has another instance,close the program,
the rendering is about to work,
however,it appears that it is still reading the verticies and halfway through it already display?false alarm?
I don't know how you are reading your model data. You should read first before you display ?
.Vertex 1 -27.6745 -150.363 -22.3534
Vertex 2 26.7081 -199.014 18.9987
Vertex 3 40.7951 -200.1 18.5202
Vertex 4 -5.85215 -148.649 32.2993
Vertex 5 -62.7425 -115.67 0.0102861
Vertex 6 -34.8256 -24.1991 -24.3786
Vertex 7 7.72046 7.05242 -16.6106
Vertex 8 19.9969 -100.416 -60.7215
Vertex 9 63.5247 -126.864 -26.3147
there is another file with:
Vertex 1 40.9791 189.743 -727.882
Vertex 2 41.4823 188.372 -726.062
Vertex 3 40.7936 187.195 -727.055
Vertex 4 41.9104 189.779 -725.824
Vertex 5 40.5246 185.65 -727.031
i found out there is a data model with
Vertex 1 -27.6745 -150.363 -22.3534
Vertex 2 26.7081 -199.014 18.9987
Vertex 3 40.7951 -200.1 18.5202
Vertex 4 -5.85215 -148.649 32.2993
Vertex 5 -62.7425 -115.67 0.0102861
Vertex 6 -34.8256 -24.1991 -24.3786
Vertex 7 7.72046 7.05242 -16.6106
Vertex 8 19.9969 -100.416 -60.7215
Vertex 9 63.5247 -126.864 -26.3147
greater than >1,what should I do?
there is another file with:
Vertex 1 40.9791 189.743 -727.882
Vertex 2 41.4823 188.372 -726.062
Vertex 3 40.7936 187.195 -727.055
Vertex 4 41.9104 189.779 -725.824
Vertex 5 40.5246 185.65 -727.031
my vertex file with 0<x<1 manage to display at the very least
could it be because it is it is in the mainloop that is why loop all the time/
Scaling ? You can either scale inside OpenGL using glScalef function, or you can always scale it yourself.
Don't get you. Are you saying that you can codes that run in the main thread of the process after invoking then "glutmainloop" function ?
You can't do that, because "glutmainloop" function is helping you by managing the windows events. It will only return from the "glutmainloop" function when you end the opengl program. You should do whatever you need to do before the "glutmainloop" invocation.
If you are building a meshviewer that will still enable you to load a new mesh after the program has been loaded, it has to be done via events handling concept.
For eg: create menu where you can choose and a file chooser dialog box opens and then you choose the new mesh to open.
you mean i have to perform glScalef?
yes,i need a filechooser.
Why not ? If the scale of the mesh is larger than what your camera's FOV (or more precisely your view frustum) can accommodate, you either scale down the model or you widen your FOV. The effect is not all the same since large FOV introduce perspective distortion while scaling down your model is a linear function.