View Full Version : saple code
04-19-2001, 02:04 AM
hi, i will not ask any question about coding.
i heard that there a few programs in which you change the properties (like color, position,light...)of the objects from a txt document. If u know such programs please give me the address, thanks..
04-19-2001, 05:24 AM
Why not ask questions about coding? This is a coding forum, is it not? http://www.opengl.org/discussion_boards/ubb/smile.gif
What you want is really pretty simple. Just store your data in a text file and read that in for use in OpenGL... I don't quite understand what the problem you are having is. Here's a quick example of a display function that reads the data from a file. Just color and vertex data for this example... the text file would be stored like so
r1 g1 b1
x1 y1 z1
r2 g2 b2
x2 y2 b2
if (fin >> r >> g >> b)
if (fin >> x >> y >> z)
Thank's Deiussum. I suppose I would have typed a thousands fingermiles more of code with the standard i/o library before I would have seen the easy-of-use of these filestreams.
Maybe I should not only use my C++ Book as a paperweight, writing-pad, toilet-paper or doorstopper.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.