• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Normals problem with Vertex Array

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1dragon376  Members

Posted 02 September 2001 - 01:40 PM

It seems that my codes doesn''t look at the Normal array for some reason. When I run the code, on face looks bright the other looks dark, though it has the same Normal... What am I doing wrong? (for now I use flat shading) Here is the code : double Varray[] = { -9.1862001419067383,0.,-14.746000289916992, -9.1862001419067383,0.,5.6476001739501953, -9.1862001419067383,20.819299697875977,5.6476001739501953, -9.1862001419067383,20.819299697875977,5.6476001739501953, -9.1862001419067383,20.819299697875977,-14.746000289916992, -9.1862001419067383,0.,-14.746000289916992 }; double Narray[] = { -1.0,0.0,0.0, -1.0,0.0,0.0 }; glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer( GL_DOUBLE, 0, Narray); glVertexPointer( 3, GL_DOUBLE, 0, Varray); glDrawArrays(GL_TRIANGLES, 0, 6);

### #2zedzeek  Members

Posted 02 September 2001 - 02:01 PM

u have 6 vertices thus u must supply 6 normals as well.

double Narray[] = {
-1.0,0.0,0.0,
-1.0,0.0,0.0,
-1.0,0.0,0.0,
-1.0,0.0,0.0,
-1.0,0.0,0.0.
-1.0,0.0,0.0 };

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.