Skip to main content
gamedev.net
🔒 Locked

3d objects

Started by a38750 0 replies 550+ views
Original Post
a38750
a38750
Ok here''s what I''ve done for my game''s object struct so far:
    
struct sub_object_t {
    vertex *v;       //array of vertices

    int nv;          //no. of vertices

    int primt;       //like TRIANGLE_STRIP

    texture_t *tex;  //texture to wrap on this primitive

};

struct object_t {
    sub_object_t *sobjs; //array of sub objects

    int nsobjs;          //no. of sub objects

};

struct entity_t {
    object_t *obj;
    matrix_t pos;
    matrix_t orientation;
    matrix_t scale;
};
    
hope someone can make sense of what I''m trying to do here. This is a cut down version, I''m just trying to show my understanding of the topic. object_t is suppost to be a general object holder. It''s got an array of sub objects, like arms and stuff. Is this how it''s "suppost" to be done? How would I go about loading an x file or something into this? How would I animate it? thanks for any help, Frank

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.