hey all…
i just want to ask how to read a set of vertices representing an object from a file…and draw the given object??
thank u
hey all…
i just want to ask how to read a set of vertices representing an object from a file…and draw the given object??
thank u
For the former, that’s totally up to you and outside the scope of OpenGL.
For the latter, google OpenGL tutorials. NeHe and Lighthouse are a few good ones.
i don’t know what u mean … but i need the way to read a vertices …of lines from an existing file and draw it!!
David, do you realize that your question is totally meaningless?
ok i will explain more…lol …
i have a homework to read a point from a file by the OpenGl … and draw the line (glVertix) but the readen point from a file (existing text file) … now it clear???
so if the text file includes
3 4
5 6
7 8
4 7
the openGl with draw lines with the given point … .(3,4) , (5,6) … and so on…
Still it is NOT an OpenGL question!
How about changing the forum?
Reading from the file depends on programming language, and if you have a homework to draw a line, I guess that your teachers have shown you how to read data from file…
eee…no … so u can’t help me ?? i don’t know!!
What programming language do you use? That would be a good start…
c++…and thank u very much
I have a suggestion which will divide your assignment up into a C++ programming part, and an OpenGL graphics part. The C++ part will be reading the data in from a text file. The OpenGL part will be plotting the line. Try to write an OpenGL/C++ program that plots a line from points defined in an array. Use the coordinates you list above, put them into an array using simple assignment statements (not reading them in from a file), and plot them. If you can do that, you’re 3/4 done with your assignment. If you can’t do that, you’ll at least be able to ask the forum some specific, OpenGL-related questions. See NeHe Tutorials 1 & 2 for source code to open up an OpenGL window, set up coordinate systems, etc.
Good luck.