The normal map generated from 3D computer graphics software is usually in tangent space. It encodes the normal vector in object face’s local coordinate.Figure 1. Normal mapThis means that if the normal vector is perpendicular to the object surface, its value will be [0.5, 0.5, 1] which creates the bluish colour. One advantage of tangent space normal map texture is that we can transform the normal if the object’s orientation is changed.
Try to get a new theme for my blog. I’m not very satisfied with Octopress’ slow update cycle, I decided to switch to the Jekyll.(Although Octopress is built on top of Jekyll) Since I’m not proficient in Ruby, it turned out to be a quite difficult job for me.
Below are the common operations happened during the OpenGL rendering pipeline.
今天又思考了一下 OpenGL alpha 问题。很早之前就研究过,因为一会儿 Ruby on Rails 一会儿 Node.js,翻来覆去就忘了。
I was doing WebGL lighting which requires a special normal transformation matrix:
In OpenGL clip space coordinate system is between:[-1, 1].
FramebufferFramebuffer is not a buffer. It is a collection of states, which has very low memory footprint. Imagine it is a C struct with lots of pointer to a real buffer, etc.
大二的时候学过 Computer Graphics。其中某堂课作业就是要求弄个 Mandelbrot set,当时是用的 Mesa OpenGL,仿佛弄得还多轻松的。结果时隔多年今天看了一下,连复数是咋回事儿都差不多搞忘了,赶紧复习了一下,照着教程 advanced shader 做了一个: Mandelbrot set
rvm cannot compile executable, for some reasons:12<div class='bogus-wrapper'><notextile><figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span></pre></td><td class='code'><pre><code class=''><span class='line'>... configure: error: C compiler cannot create executables ...</span></code></pre></td></tr></table></div></figure></notextile></div>This post magically solve the problem!
I have Xcode installed already, which puts an older version of git in: /usr/local/bin/
If you get an error when you do database migration, during the deployment process:1234$ heroku rake db:migraterake aborted!Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.)Tasks: TOP => db:migrate => db:load_config(See full trace by running task with --trace)Add PostgreSQL gem, replace the line gem ‘sqlite3’ with:123456group :development, :test do gem 'sqlite3'endgroup :production do gem 'pg'endThis ensures the production using PostgreSQL, since Heroku does not support sqlite3.
Regarding the “Spork” in the RoR tutorial… Do not use it!!
自从我毕业以后我就想把C++跟OpenGL捡起来,虽然现在遍地都是游戏开发平台,框架,工具。但是我依然坚持,而且我也厌倦了用Flash写东西了,估计跟工作有关。也不太想用auto garbage collection的语言写东西。还是自己手动管理内存听起来比较安逸,我是控制狂!所以现在简直就是绝好的一次机会!用了这么几个月现在的开发环境,感觉还是不错的。
很早之前就研究过关于Game loop的问题。昨天在研究Win32 game window的时候再次牵扯到了该问题。发现以前了解的game loop结构不对。
You’d better read both of them to gain the full understanding on Win32 and OpenGL setup. theForger's Win32 API Tutorial Part 1-4. NeHe OpenGL lesson 1不太喜欢用GLUT,之前用过,老是感觉很怪,比如有鼠标在屏幕上动,callback interval会变慢。另外也找不到合适的方式来设置game loop。最大的好处就是不需要写太多代码,而且跨平台。
一直搞不明白网上的人说用GJK一定要加margin。我就在想,加个屁的margin啊,直接找origin到simplex边的最短距离的那个vetor就是penetration vector嘛,直接就可以找到contact normal了嘛。结果还是证明我是睁眼瞎。
Use Seperating-Axis GJK metioned here: http://mollyrocket.com/849. Also add some kind of margin when using SA-GJK. So we can saftly do a early out, assume that if dot(A, D) < 0, no intersection. If intersection is found, in other words the SA-GJK does generate a simplex which contains the origin. Then we can use the simplex generated from SA-GJK as intial simplex input to EPA to calculate contact information, such as, contact points and normal, penetration depth.做个笔记,记录下脑袋里边东西…研究了两个星期Collision detection,看得我抓狂。反正我现在的想法就是这样的…那个所谓SA-GJK,作为一个quick test(当然在此之前还需要broad phase collision detection check),确定两个物体在有margin的情况下是否有碰撞。如果有碰撞(没碰撞,当然就没他们啥事儿了),那就需要更进一步确定是否真正的碰撞,如何碰撞的…