Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


PpenGlProg

Member Since 09 Jul 2013
Offline Last Active Aug 09 2013 11:42 PM

Posts I've Made

In Topic: glvertexpointer std::vector, struct memory opengl

17 July 2013 - 09:38 PM

Thanx! :)


In Topic: glvertexpointer std::vector, struct memory opengl

17 July 2013 - 10:05 AM

snimok33pn_1299167_8486224.png
 

 

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;
}


In Topic: glvertexpointer std::vector, struct memory opengl

17 July 2013 - 09:34 AM

http://i5.pixs.ru/storage/0/5/1/snimok32pn_9749539_8486051.png


In Topic: glvertexpointer std::vector, struct memory opengl

17 July 2013 - 09:33 AM

snimok32pn_9749539_8486051.png


In Topic: glvertexpointer std::vector, struct memory opengl

17 July 2013 - 09:32 AM

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. 

 

0306778c531et.jpg


PARTNERS