Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


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.

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

#1 dragon376   Members   -  Reputation: 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);

Sponsor:

#2 zedzeek   Members   -  Reputation: 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.



PARTNERS