OpenGL 中如何才能调出金属效果?

alphapaopao 2003-09-22 06:47:05
调了N长的时间,没有得到满意的效果。大家有没有经验参数阿?

我的参数是
#m_lightAmb
0.2, 0.2, 0.2, 0.6

#m_lightDif
1, 1, 1, 1.0

#m_lightSpe
0.7, 0.7, 0.7, 0.4

#m_lightPos
1, 1, 10, 1.0


#material_ambient
0.8, 0.8, 0.8, 0.0

#material_diffuse
0.24, 0.45, 0.68, 1.0

#material_specular
1, 1, 1, 1

#material_emission
1, 1, 1, 1.0

#GL_SHININESS
128, 128, 128, 0.1

...全文
408 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
alphapaopao 2003-09-28
  • 打赏
  • 举报
回复
发现一篇很有意思的文章,忍不住贴上来

http://sjbaker.org/teapot/
alphapaopao 2003-09-28
  • 打赏
  • 举报
回复
唉,终于发现我对矩阵的使用有错误.
看看这个吧,可能很多人犯了同样的错误: Help stamp out GL_PROJECTION abuse http://sjbaker.org/steve/omniv/projection_abuse.html
很棒的 FAQ : http://sjbaker.org/steve/omniv/

我是从 www.opengl.org 上面查到的
Where should my camera go, the ModelView or Projection matrix?
url is : http://www.opengl.org/developers/faqs/technical/viewing.htm#view0020

The GL_PROJECTION matrix should contain only the projection transformation calls it needs to transform eye space coordinates into clip coordinates.

The GL_MODELVIEW matrix, as its name implies, should contain modeling and viewing transformations, which transform object space coordinates into eye space coordinates. Remember to place the camera transformations on the GL_MODELVIEW matrix and never on the GL_PROJECTION matrix.

Think of the projection matrix as describing the attributes of your camera, such as field of view, focal length, fish eye lens, etc. Think of the ModelView matrix as where you stand with the camera and the direction you point it.

The game dev FAQ has good information on these two matrices.

Read Steve Baker's article on projection abuse. This article is highly recommended and well-written. It's helped several new OpenGL programmers.



希望大家过得愉快,呵呵
alphapaopao 2003-09-25
  • 打赏
  • 举报
回复
regainworld(午夜心跳) :
好啊好阿!! alphasun@etang.com
曾经的猎狐 2003-09-24
  • 打赏
  • 举报
回复
没玩过
regainworld 2003-09-24
  • 打赏
  • 举报
回复
有两个类,一个设置灯光,一个设置材质,里面都有配好的参数。我看效果还可以。
你要是没见过我就发给你把。

19,469

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧