Advertisement

Classes

Started by January 17, 2000 09:38 PM
4 comments, last by Esap1 24 years, 11 months ago
Ive been writing a fairly simple 3d Shooter and now wondering if this is the right way to set up the classes. World->Objects->Polygons->Vertices Then I will have pointers from the Vertex Buffer to the Vertices in the Classes. Is that how to do it? thanks in advance!
Well, this is a rather standard way of doing it in a 3D Engine, but it''s probably not the fastest way to do this in a 3D shooter type game.
Advertisement
Well, do you have any ideas then?
That kind of heirarchy makes sense, but what you don''t want to do is just return a pointer and do something like:

vertexBuffer = World->Objects->Polygons->Verticies;
draw(vertexBuffer);

You want to give the World class a draw function that calls all the objects draw() functions that calls all the polygon''s draw() functions that access the vertexBuffer.

That way whatever us using the class library doesn''t care what''s going on, you just call

World->draw()

and that''s all you need to worry about.

Apologies in advance if you were already going to do it this way.
-the logistical one-http://members.bellatlantic.net/~olsongt
What I was going to do was to Load all the Vertices and into the Vertex Buffer and while doing that make Pointers in the Vertices to the Vertex Buffer. Then have a function in the World Class that Reads the vertices from the Vertex Buffer and Reads the texture info from the Polygons Class and whatever else. Is that way OK?? or is there a better way?
WHOOPS, that was me
What I was going to do was to Load all the Vertices and into the Vertex Buffer and while doing that make Pointers in the Vertices to the Vertex Buffer. Then have a function in the World Class that Reads the vertices from the Vertex Buffer and Reads the texture info from the Polygons Class and whatever else. Is that way OK?? or is there a better way?

This topic is closed to new replies.

Advertisement