3D Object Classes

Started by
14 comments, last by Vendayan 22 years, 6 months ago
I''m pretty new to 3D game programming and i was wondering if anyone could give me a basic example of a 3D object class? I really dont need to know all the code in any methds, I just need to have something to give me an idea of how i need to store my objects in model space and worldspace. Please give me as much help as possible, I''m at a real loss here. ~Vendayan
"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"~Vendayan
Advertisement
I suppose I should be a bit more specific, I''m using VC++ 6.0 to write this with DirectX 8.0

~Vendayan
"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"~Vendayan
do you want to learn to make a 3D software engine (from the grounds up) or simply use Direct3D to render 3D objects?
He wants to know how a class for objects should be set up I think.
Well Im actually trying to learn how to make a 3D engine from the ground up, although I understand most of what needs to be done. Im simply wondering what would be the best way to make the class for objects, and a type of hierarchy for them as well. I know the DirectX functions well enough and Ive read shelves of books full about them, but for some reason I still cant see the best way to set up the class. I also have a good feeling that it may be all that I need to know to actually start some serious work on my app.

~Vendayan
"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"~Vendayan
Hi,

I think that small static objects aren''t any problem, because you can just load them (Of course, you need to know which file format you want to implement), store them in a vertex array (or vertex buffer, in DX terms) and push them onto you graphics board.

Do you want to use some sorting-techniques such as BSP-Trees, Octrees, etc., or do you want to draw some simple objects in the beginning? Thats a bit more complex...
Huh...?

Ok im somewhat new to this, If I have an example of how I should store my primitives in the form of an object I can very easily find my own efficient way of rendering them, I simply need an idea of a class that would let me store me store all the information and some of the methods I will need.

For instance I''m not entirely sure if I should use a VB for each primitive or each object, and for that matter if I should really use them at all. I would also like to include a function for calculating bounding spheres, tht would be called whenever the object would animate itself or be scaled / stretched etc. I am also not entirely sure how I should go about storing objects in model space and moving them into world space.

Like I said, I''m at a complete loss here

~Vendayan
"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"~Vendayan
If possible could anyone try to post some code for me to see?

~Vendayan
"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"~Vendayan
Perhaps you can get some hierarchy ideas at www.baskuenen.myweb.nl (click on "C++ Classes" and "C++ 3D Game Engine").
That didnt really help much, I looked at the code they had but it was nothing like what im looking for. I am just looking for something that would tell me how to set up the vertex buffers for the objects and how to use them.

I have also been wondering if anyone could answer this simple question for me - If you are defining primitives by indexes then how do you give each vertex all the different texture coordinates it will need for the different primitives that it makes.

~Vendayan
"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"~Vendayan

This topic is closed to new replies.

Advertisement