PpenGlProg

Members
  • Content count

    11
  • Joined

  • Last visited

Community Reputation

120 Neutral

About PpenGlProg

  • Rank
    Member
  1.     void Obj_render::DrawObject() { glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glVertexPointer( 3, GL_FLOAT, sizeof( Vertex ), &verts.data()->pos ); glNormalPointer(GL_FLOAT,sizeof( Vertex ),&verts.data()->norm); glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), &verts.data()->tex); glDrawArrays( GL_TRIANGLES, 12,indices.size()); glDisableClientState(GL_VERTEX_ARRAY); std::cout << glGetError() << std::endl; }
  2. http://i5.pixs.ru/storage/0/5/1/snimok32pn_9749539_8486051.png
  3. thx for answer. i use  this is obj file   # Blender v2.63 (sub 0) OBJ File: '' # www.blender.org mtllib 1.mtl o Cube v 1.000000 -1.000000 -1.000000 v 1.000000 -1.000000 1.000000 v -1.000000 -1.000000 1.000000 v -1.000000 -1.000000 -1.000000 v 1.000000 1.000000 -0.999999 v 0.999999 1.000000 1.000001 v -1.000000 1.000000 1.000000 v -1.000000 1.000000 -1.000000 usemtl Material s off f 1 2 3 4 f 5 8 7 6 f 1 5 6 2 f 2 6 7 3 f 3 7 8 4 f 5 1 4 8   this is cube.   
  4. Hello, i use struct struct Vertex { float pos[3]; float tex[2] = {0, 0}; float norm[3] = {0, 0, 0}; int index_mtl; }; i use vector std::vector<Vertex> verts; how use "glvertexpointer" for my struct vector. I wanted to drawing by that function. in the end I did not succeed. void Obj_render::DrawObject() { glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, verts.data()->pos); glDrawArrays(GL_TRIANGLES,0,3); // deactivate vertex arrays after drawing glDisableClientState(GL_VERTEX_ARRAY); }  
  5. Properly implemented loader objects?

    Thanks for the answer
  6. Properly implemented loader objects?

    Rus:   ???????????, ??????? ? ????? ???????? ????????? ???????? ??? OpenGL, ???????? ??? ????? ????? ?????, ???? ??????????, ????????? ?? ? ??? ?????? ??? ???? ?????-?? ????????, ??????? ??????? :) 
  7. Properly implemented loader objects?

      Thank you. Yes Russian   
  8. Properly implemented loader objects?

    it is what I used.   sorry.
  9. hello  . I have implemented a loader object that all true I do?   I attached the source file.