Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411643 Posts in 69394 Topics- by 58450 Members - Latest Member: pp_mech

May 14, 2024, 09:42:06 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsOpen GL Wikibook Tutorial Issue
Pages: [1]
Print
Author Topic: Open GL Wikibook Tutorial Issue  (Read 1809 times)
Hedgehodg
Level 1
*


...


View Profile
« on: July 27, 2012, 07:57:07 PM »

In the Wikibook for Open GL 2.1 I am having issues with the first tutorial for the lighting arc, the author doesn't explain what half the "stuff" is used for. For example, what am I meant to pass to the following function?

Code:
glm::mat3 m_3x3_inv_transp = glm::transpose(glm::inverse(glm::mat3(mesh.object2world)));
glUniformMatrix3fv(uniform_m_3x3_inv_transp, 1, GL_FALSE, glm::value_ptr(m_3x3_inv_transp));

Throughout all the tutorials a "mesh" structure/class is never created. Does anyone know what I should pass to the glm::mat3 function in "mesh.object2world"s stead?

http://en.wikibooks.org/wiki/GLSL_Programming/GLUT/Diffuse_Reflection
Logged

Previously known as "darestium"...
Liosan
Level 2
**


View Profile
« Reply #1 on: July 27, 2012, 09:01:12 PM »

There's a comment right above that:
Code:
 /* Transform normal vectors with transpose of inverse of upper left
     3x3 model matrix (ex-gl_NormalMatrix): */
You need the model matrix for the mesh you are currently rendering; as in, the matrix representing the meshes translation, rotation and scaling.

Liosan
Logged

Hedgehodg
Level 1
*


...


View Profile
« Reply #2 on: July 28, 2012, 04:31:27 PM »

Thanks Smiley
Logged

Previously known as "darestium"...
Hedgehodg
Level 1
*


...


View Profile
« Reply #3 on: July 28, 2012, 10:47:12 PM »

I was wondering if anyone could help me with this: http://gamedev.stackexchange.com/questions/33156/lighting-problems-with-terrain ... Please Smiley
Logged

Previously known as "darestium"...
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic