Azrul
November 28th, 2006, 11:47 PM
this might be a noob question..
i can plot a points using openGL and i can open a point file using the fstream fuction. but i cant do both in one file, meaning, i dont have any idea how to plot a points with the data stored in a file.
now, i've been searching a lot of book, and particularly they dont have these example..
by the way, i'm doing my final year project on utilizing openGL for terrain visualization.
thanks in advance!
attached jpg file included..
Zachm
November 29th, 2006, 03:40 AM
What you are trying to do is a bit unclear to me.
1. Are you having trouble reading points data from a file ?
2. Are you trying to draw the points stored in the file "on-the-fly" - read a point and plot it right away ?
If the latter is true, why do it that way ? read all of the points to memory and plot it from there.
Azrul
November 29th, 2006, 09:40 PM
thanx for the reply..
the problem is setted now, regarding you question.. yes, i want to draw the points stored in the file "on-the-fly" - read a point and plot it right away.. i didnt want to put it on the memory because the program i wrote meant for any data file. it means that anyone who have the x,y,z data file can generate terrain. plus, iw u have about 10,000 points in file, how long do u think it will take?
but new problem have arrive, because of the point is in this format:
*******************************************
626721.610226,172584.422391,28.250000
626721.617500,172584.516654,28.250000
626721.633103,172584.719115,28.250000
626721.651369,172584.957644,28.250000
626721.666632,172585.160112,28.250000
626721.673226,172585.254391,28.250000
626721.673226,172585.254391,28.250000
*******************************************
they point could not be plotted..
i tried using sample data..
*******************************
12.0,7.5.9.0
15.0,99.5,10,0
76.0.-18.0,12.0
*******************************
with no problem, the pint can be plotted..
is this got to do with the datatype.. or the clipping range --> glOrtho?
or the projection?
Azrul
November 30th, 2006, 01:19 AM
the problem is settled!
glOrtho does the trick.. i corrected some value.. then walla.. all the point is plotted...