drawing or displaying vertex normal

shru_ani
Unregistered
 
Post: #1
hi all

am new to this forum, am in desperate need of c or c++ code snippet to display or draw vertex normal with mesh. can u guys pls help me...

thanks in advance
shru
Quote this message in a reply
Apprentice
Posts: 13
Joined: 2006.10
Post: #2
Code:
glBegin(GL_LINES);
glVertex3f(vertex_x, vertex_y, vertex_z);
glVertex3f(vertex_x + normal_x, vertex_y + normal_y, vertex_z + normal_z);
glEnd();
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #3
Note that depending on your coordinate system, you may want to multiply the normal values by a constant so they aren't way too big, or way too small.
Quote this message in a reply
shru_ani
Unregistered
 
Post: #4
Thank u so much guys............ it worked
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Normal Mapping Precision on iOS OptimisticMonkey 6 17,325 Apr 13, 2011 11:35 PM
Last Post: OptimisticMonkey
  Another beginner's question about displaying an animated object superlemonster 2 4,805 Jan 28, 2011 08:03 AM
Last Post: OptimisticMonkey
  Getting the Normal for a polygon. Jaden 3 5,771 May 1, 2009 01:47 PM
Last Post: Nosredna
  Simple OpenGL 2d test - nothing displaying SaxMan 8 6,449 Jan 19, 2009 12:04 AM
Last Post: TythosEternal
  Vector (Normal) Map blending operations? kelvin 10 6,697 Mar 16, 2007 04:31 PM
Last Post: OneSadCookie