wu_kuan
03-14-2003, 01:56 AM
I have studied opengl for a month,and I have been thinking about how to encapsulate OpenGL so I can using OpenGL in OO way.
We can abstract basic geometries such as triangle,point,and line because they are drawn by similar steps. And maybe we can write a class called MyLight,it contains all properities and effects that a light has . And we can write a 'Assemble' class which can hold 'geometry' objects and 'light' objects , rotate a 'Assemble' means rotate all objects it holds.
With these and other classes, we can control a 'tank' in a very convenient way,so we can control big and complex scene.
The most difficult thing is , how can I control states and combined effect( a geometry may draw under various combination of lights,materials,normals,and other) in OO way .
Can somebody give me some advices or tell me similar things that someone has already done?
finally, thank you for reading this ,and I am sorry for my poor English.
We can abstract basic geometries such as triangle,point,and line because they are drawn by similar steps. And maybe we can write a class called MyLight,it contains all properities and effects that a light has . And we can write a 'Assemble' class which can hold 'geometry' objects and 'light' objects , rotate a 'Assemble' means rotate all objects it holds.
With these and other classes, we can control a 'tank' in a very convenient way,so we can control big and complex scene.
The most difficult thing is , how can I control states and combined effect( a geometry may draw under various combination of lights,materials,normals,and other) in OO way .
Can somebody give me some advices or tell me similar things that someone has already done?
finally, thank you for reading this ,and I am sorry for my poor English.