Jump to content
  • Advertisement

MSobiecki

Member
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

122 Neutral

About MSobiecki

  • Rank
    Newbie
  1. I've got a few questions related with class storing models (meshes) data. I started with something like this: class cModel : public cObject { struct sMesh { /// number of different vertexes int diffVertexNum; float *vertex; // *3 float *normal; // *3 // texture coordinates etc will be here int realVertexNum; int *index; }; int meshNum; sMesh *mesh; public: cModel(); int load(const char *file); void free(); void draw(); }; And after this part of code I started to think and wonder ;p My problem is not loading or free'ing models, but drawing with high performance and not using too much memo. 1) I want to use indexed vertex arrays - and here the first question - is this the best way ? I want my models to be modifiable, so display lists are not good enough for me, begin/end is slow (but easy to use, this is my other problem (2)). Are there any other (better) methods of drawing geometry? 2) In each tutorial I found model was stored like this: // pseudocode struct vertex { ... }; struct triangle { int *vertexIndexes; int normalNum; vector3 *normal; ... }; struct mesh { int triangleNum; triangle *triArray; ... }; class model { int vertexNum; vertex *vertArray; int meshNum; mesh *meshArray; ... }; Something similar I is in nehe #31, in many net resources, even in Hugi. Is there a method to draw something organized like this really fast (not using glVertex3f / glNormal3f ... in a loop? 3) I think that my model class problem is memory needed to store it. For example - if the model is a cube - each vertex has to be stored three times due to different normal values. (cube isn't smooth). In such not-smooth cases I loose memo on storing vertexes and the NeHe-like model is much better (but still question of drawing it). Is there a way to connect this to styles? I'll be happy to receive any suggestions, any advice.
  2. MSobiecki

    Radeon 9200 driver bug ?

    Heh man, you completely didn't understand what I meant. I'm not that stupid to try to make wireframe using antyaliasing. Look at the first screen - no wire is visible. Look at the second one - there is something that looks like mesh wire on the model can you see it ? The only difference between the two apps being run on these screens is - the second has polygon smooth enabled.
  3. MSobiecki

    Radeon 9200 driver bug ?

    I thought that this is quite obvious what exactly I mean - the pseudo wire-frame effect.
  4. I've allready posted this message on the OpenGL board, but it's very important for me and I want to know gamedev folks opinion ;p I've got a problem with GL_POLYGON_SMOOTH on radeon 9200, and it's not my first contact with this problem. Screens will illustrate it perfectly.. polygons NOT smoothed: http://img105.imageshack.us/my.php?image=fmse01ft0.jpg polygon smoothed: http://img250.imageshack.us/my.php?image=fmse02xg0.jpg The question is - have anybody encountered this kind of problem ? Is it only radeon 9200 problem ? Is there any way to prevent it ?
  5. MSobiecki

    [C++][Ubuntu]Clear Console Window

    As far as I know main reason's against syscalls are portability and performance, if you are sure, you won't ever need to run app using system("command") under os where command doesn't exist, and that you don't need extreme high performance, or it's not going to have big influence, then use it :) [edit] As a matter of fact, system() is usually easier to port than ncurses (yes, you can use pdcurses, but there are some problems with it, and changing commands names isn't that big ammount of work) under win you have cls not clear, so you will have to make some changes in code, or ifdef'it to make os-sensitive compilation while implementing ;)
  6. MSobiecki

    [C++][Ubuntu]Clear Console Window

    If you only wanna clear, then system("clear"); will make it for you :)
  7. MSobiecki

    typedef or not?

    IF it does, but as far as I know (ofc I may know wrong ;p) C++ language doesn't guarantee it, and if so, then it's not well practice to do like this.
  8. MSobiecki

    typedef or not?

    I use typedefing structs in C++ due to my C habits, I simply like such structs defs, and it doesn't influence performance. I also use very often (only for structs, never for classes) smth like this: typedef struct { (..) } blah, *blahPtr; It's quite usefull for me. Quote: void f3(T1 p) // error: already defined Hmm not true ;> I think you meant void f1(T1 p) as for overloaded function - you have different function name here, no error will be returned ;) Quote:T2 t2 = s; // error: unrelated types. As a matter of fact you are not (or shouldn't be allowed to do something like that: T2 a, b; (..) a = b; unless you overload = operator, and you can do it as well for (T2, T2) as for (T2, T1) ;> Greets [edit] You were quicker with this overloading ;p You answer too fast ;p
  9. MSobiecki

    ? about Data Structures

    Relax man, if you forgot how to code in two weaks time, then you couldn't code before. This means you have to learn :) In data structures you will have to operate on pointers and dynamic mem allocations, and this is the most difficult thing to get through for beginners in my opinion :) Read, read, code, code, and code and you will learn it, just relax :)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!