Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

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


Sign up now

Normals problem with Vertex Array

4: Adsense

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.


  • You cannot reply to this topic
1 reply to this topic

#1 dragon376   Members   

140
Like
Likes
Like

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

#2 zedzeek   Members   

528
Like
Likes
Like

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.