<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4842848464089703396</id><updated>2011-10-11T21:12:15.313+08:00</updated><category term='mipmap'/><category term='uv'/><category term='texturing'/><category term='virtual texturing'/><category term='math course'/><category term='work item'/><category term='bug'/><category term='blending'/><category term='shader'/><category term='box-spline'/><category term='mask'/><category term='graphics memory'/><category term='subdivision surface'/><category term='哲学'/><category term='mesh'/><category term='application'/><category term='vertex batch'/><category term='weekly update'/><category term='gaussian'/><category term='Bezier Patch'/><category term='editting'/><category term='design pattern'/><category term='quad'/><category term='renderer'/><category term='fractal'/><category term='bug series'/><category term='CPU'/><category term='reading notes'/><category term='parameterization'/><category term='B spline'/><category term='graphics engine'/><category term='course'/><category term='hsv'/><category term='Mesh processing'/><category term='windows'/><category term='surface'/><category term='image'/><category term='2d graphics'/><category term='vector'/><category term='c++'/><category term='OpenGL'/><category term='patch'/><category term='paper'/><category term='tech'/><category term='extensions'/><category term='camera'/><category term='opencl'/><category term='blend mode'/><category term='random'/><category term='VBO'/><category term='宗教'/><category term='intersection'/><category term='transformation'/><category term='link error'/><category term='math series'/><category term='equations'/><category term='r-value'/><category term='memory'/><category term='Bezier'/><category term='pointer'/><category term='opengl32.dll'/><category term='book'/><category term='gui'/><category term='layer'/><category term='hsl'/><category term='filter'/><category term='blur'/><category term='胡思乱想'/><category term='c'/><category term='geometry'/><category term='alpha'/><category term='company'/><category term='ui'/><category term='gpu'/><category term='rgb'/><category term='simplification'/><category term='intel'/><category term='glsl'/><category term='optimization'/><category term='partition'/><category term='l-value'/><category term='external'/><category term='qt'/><category term='architeture'/><category term='box filter'/><category term='curvature'/><category term='tree'/><category term='指令集'/><category term='laplacian'/><title type='text'>keep it simple</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>80</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-4708405733700695309</id><published>2011-10-11T21:12:00.001+08:00</published><updated>2011-10-11T21:12:15.667+08:00</updated><title type='text'></title><content type='html'>有一个难题，例如一个大的三角形里面随便画几个stroke，可能是相交的，怎么根据strokes来对这个三角形做三角剖分，得到的还是三角形，不包含多边形。&lt;div&gt;想一个算法来解决问题的过程（这些问题不是text book上有标准answer的）：先想/实现一个简单的情况，例如都没有相交(怎么判断相交?), 然后假如有某种相交，在原来实现的算法上加入一些cases，然后假如还有某种复杂的情况，在原来实现的算法上在加入一些cases.... (没有想到的某些情况，就留到bug了)....&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;1. 是一个渐进的过程。&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;2. 别老是想重写。&amp;nbsp;&lt;/div&gt;&lt;div&gt;假如在假如某些cases or 想着想着 想要重写，多半不是good idea，因为很可能重写之后包含了新的cases但遗漏了旧的cases.&amp;nbsp;&lt;/div&gt;&lt;div&gt;假如在过了一段时间回来这codes fix bugs时候，想要重写，多半不是good idea，因为很可能连当初为什么那样写都想不清楚or想不齐所有旧的cases.&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-4708405733700695309?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/4708405733700695309/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/10/strokestrokes-text-bookanswer.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4708405733700695309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4708405733700695309'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/10/strokestrokes-text-bookanswer.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1426103708830398844</id><published>2011-08-29T15:15:00.002+08:00</published><updated>2011-08-29T15:21:02.077+08:00</updated><title type='text'></title><content type='html'>怎么定义一个QuadTriMesh, 同时支持quad and triangle faces?&lt;div&gt;&lt;br /&gt;&lt;div&gt;class QuadTriMesh : public BaseMesh {&lt;/div&gt;&lt;/div&gt;&lt;div&gt;public:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;struct Face;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;...&lt;/div&gt;&lt;div&gt;};&lt;/div&gt;&lt;div&gt;#define NIL uint(~0)&lt;/div&gt;&lt;div&gt;struct QuadTriMesh::Face {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;unsigned int id;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;unsigned int v[4];&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;bool isQuadFace() const { return v[3] != NIL; };&lt;/div&gt;&lt;div&gt;};&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1426103708830398844?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1426103708830398844/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/08/quadtrimesh-quad-and-triangle-faces.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1426103708830398844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1426103708830398844'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/08/quadtrimesh-quad-and-triangle-faces.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-7982629674804520756</id><published>2011-08-23T18:45:00.001+08:00</published><updated>2011-08-23T18:45:48.115+08:00</updated><title type='text'></title><content type='html'>&lt;div&gt;- 养成习惯工作在早上就开始做，别看看新闻推到下午or晚上。&lt;/div&gt;&lt;div&gt;- 修改某mesh operation的错误时候最难最怕就是等为出错在哪些face/vertex/edge, 如果能在maya中建一些简单的模型来重现, 这就好办了。&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- 不想改变的变量加const.&lt;/div&gt;&lt;div&gt;- 考虑函数里的指针加QScopedPointer&amp;lt;T&amp;gt; ...&amp;nbsp;&lt;/div&gt; &lt;div&gt;- C++ Destructor: 1. 子类的destructor总会自动调用父类的destructor吗?&amp;nbsp;&lt;/div&gt;&lt;div&gt;2. destructor里面除了需要delete pointers之外其它的变量呢?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- &lt;a href="http://www.mikeash.com/pyblog/friday-qa-2011-01-04-practical-floating-point.html"&gt;http://www.mikeash.com/pyblog/friday-qa-2011-01-04-practical-floating-point.html&lt;/a&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&amp;nbsp; &lt;a href="http://altdevblogaday.com/2011/08/21/practical-flt-point-tricks/?utm_source=twitterfeed&amp;amp;utm_medium=twitter"&gt;http://altdevblogaday.com/2011/08/21/practical-flt-point-tricks/?utm_source=twitterfeed&amp;amp;utm_medium=twitter&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;-what is LLVM ?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- &lt;a href="http://code.google.com/p/alembic/"&gt;http://code.google.com/p/alembic/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.cgsociety.org/index.php/CGSFeatures/siggraph2011#alembic_1.0"&gt;http://www.cgsociety.org/index.php/CGSFeatures/siggraph2011#alembic_1.0&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- OpenColorIO (OCIO) is a new open source project from Sony Pictures Imageworks (SPI), which they hope will soon be widely adopted across the Industry. SPI &amp;ndash; it must be said, especially since Rod Bredow took the role of CTO, &amp;ndash; has excelled at meeting the open source community head on and spearheading along with ILM (and their OpenEXR work) &amp;ndash; some of the most impressive displays of industry co-operation we have seen in years, if not decades.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- &lt;a href="http://advances.realtimerendering.com/s2011"&gt;http://advances.realtimerendering.com/s2011&lt;/a&gt;/ &amp;nbsp;Advances in Real-Time Rendering in 3D Graphics and Games.&lt;/div&gt;&lt;div&gt;&lt;a href="http://iryoku.com/aacourse"&gt;http://iryoku.com/aacourse&lt;/a&gt;/ ACM SIGGRAPH 2011 Course Filtering Approaches for Real-Time Anti-Aliasing&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- &lt;a href="http://fgiesen.wordpress.com/"&gt;http://fgiesen.wordpress.com/&lt;/a&gt; A trip through the Graphics Pipeline 2011.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- John Carmack (ID_AA_Carmack) on Twitter: Reading &amp;quot;Infrastructure: the book of everything for the industrial landscape&amp;quot;. Much respect to civil engineers!&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-7982629674804520756?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/7982629674804520756/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/08/or-mesh-operationfacevertexedge-maya.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7982629674804520756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7982629674804520756'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/08/or-mesh-operationfacevertexedge-maya.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-6254792830361773904</id><published>2011-08-16T12:07:00.001+08:00</published><updated>2011-08-16T12:07:45.725+08:00</updated><title type='text'></title><content type='html'>&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- &amp;quot;Low-pass filtering statistics&amp;quot;,&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- Eigen library (&lt;a href="http://eigen.tuxfamily.org"&gt;http://eigen.tuxfamily.org&lt;/a&gt;)&amp;nbsp;&lt;/div&gt;&lt;div&gt;Eigen&amp;#39;s Geometry module provides two different kinds of geometric transformations:&lt;/div&gt; &lt;div&gt;1. Abstract transformations, such as rotations (represented by angle and axis or by a quaternion), translations, scalings. These transformations are NOT represented as matrices, but you can nevertheless mix them with matrices and vectors in expressions, and convert them to matrices if you wish. 这种类型描述的都是Pure R/T/S.&amp;nbsp;&lt;/div&gt; &lt;div&gt;2. Projective or affine transformation matrices 两种: see the Transform class. These are really matrices. 其实是Represents an homogeneous transformation in a N dimensional space.&amp;nbsp;&lt;/div&gt;&lt;div&gt;例如这是一个affine transformation matrix的例子, 描述的是concatenation_of_any_transformations: Transform&amp;lt;float,3,Affine&amp;gt; t = Translation3f(p) * AngleAxisf(a,axis) * Scaling3f(s);&amp;nbsp;&lt;/div&gt; &lt;div&gt;An affine transformation matrix M is shaped like this:&lt;/div&gt;&lt;div&gt;( linear &amp;nbsp; translation )&lt;/div&gt;&lt;div&gt;( &amp;nbsp;0...0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; ) // the last row can be assumed to be [0...0 1]&lt;/div&gt;&lt;div&gt;Note that for a projective transformation the last row can be anything, and then the interpretation of different parts might be sightly different.&lt;/div&gt; &lt;div&gt;Isometry if the transformation is only a concatenations of translations and rotations. (In Euclidean geometry, a rotation is an example of an isometry, a transformation that moves points without changing the distances between them. from wikipedia)&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Transformation Types:&lt;/div&gt;&lt;div&gt;2D rotation from angle &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Rotation2D&lt;/div&gt;&lt;div&gt;3D rotation as an angle + normalized axis AngleAxis&lt;/div&gt;&lt;div&gt;&amp;quot;Finally Rotation2D and AngleAxis are mainly convenient types to create other rotation objects.&amp;quot; These are two most simplest rotation types.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- 遇到一个bug. QA用的版本可以稳定重新，但是我就是不能重现，所以我怀疑daily build是不是包含了最新的code. 后来试了最近的check in也包含在daily build里面, 应该就不是没有包含最新code了。同事建议看看release 和 debug版本。果然release version可以重新 debug版本不可以重新. 一直跟踪发现原因一个数组值没有初始化, 在debug中被初始化为3452816845 也就是0xcdcdcdcd, 但在release下大部分是0.&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- NVIDIA path render,&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- 工作需要了解求Normal Map细节，于是读了NVIDIA mesh tool(&lt;a href="http://code.google.com/p/nvidia-mesh-tools/)"&gt;http://code.google.com/p/nvidia-mesh-tools/)&lt;/a&gt;中NVMeshMender的实现, 知道了Tangent space的求法, 例如先根据uv求出TB然后假如N的时候考虑smoothgroup. &amp;nbsp;NVIDIA的工具Melody虽然没有给出代码实现, 但可以玩玩normal map的生成.&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- &amp;quot;State of the Art Report, Survey of Real-Time Tessellation &amp;amp; Geometry Synthesis Methods&amp;quot; 罗列了相关papers.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- &lt;a href="http://www.lysator.liu.se/c/c-faq/c-1.html"&gt;http://www.lysator.liu.se/c/c-faq/c-1.html&lt;/a&gt; C-FAQ.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- Check the QScopedPointer for resource acquisition is initialization(RAII), and QSharedPointer for reference count.&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-6254792830361773904?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/6254792830361773904/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/08/filtering-statistics-eigen-library.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/6254792830361773904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/6254792830361773904'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/08/filtering-statistics-eigen-library.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1576728532014647603</id><published>2011-08-12T10:28:00.001+08:00</published><updated>2011-08-12T10:28:16.572+08:00</updated><title type='text'>代码bug</title><content type='html'>昨天写代码犯了个错误：&lt;div&gt;子类override父类的virtual member function时候不需要写函数参数的default values。&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1576728532014647603?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1576728532014647603/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/08/bug.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1576728532014647603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1576728532014647603'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/08/bug.html' title='代码bug'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-4601472920744303628</id><published>2011-07-29T16:23:00.002+08:00</published><updated>2011-07-29T16:25:21.123+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mesh'/><title type='text'>顶点 边 面 数目的关系</title><content type='html'>&lt;div&gt;今天看模型时候观察到了一个规律，原来这个规律还有理论支持。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="https://picasaweb.google.com/lh/photo/uRAywA-8QJUvXlnr85Cnl6Naa-XtbnG49KUu8uq_aXg?feat=embedwebsite"&gt;&lt;img src="https://lh3.googleusercontent.com/-FxRw2OpaUw0/TjJttKpUjjI/AAAAAAAAAuw/Xwtv82eSdGM/s800/Untitled.jpg" height="563" width="800" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-4601472920744303628?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/4601472920744303628/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/blog-post_29.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4601472920744303628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4601472920744303628'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/blog-post_29.html' title='顶点 边 面 数目的关系'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh3.googleusercontent.com/-FxRw2OpaUw0/TjJttKpUjjI/AAAAAAAAAuw/Xwtv82eSdGM/s72-c/Untitled.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-651024692757914214</id><published>2011-07-28T20:50:00.000+08:00</published><updated>2011-07-28T20:51:14.667+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='math series'/><title type='text'>三角面local frame上的tangent</title><content type='html'>&lt;a href="https://picasaweb.google.com/lh/photo/6f4dv46BdGoJ_hrZ4_BcgaNaa-XtbnG49KUu8uq_aXg?feat=embedwebsite"&gt;&lt;img src="https://lh3.googleusercontent.com/-8aeyJmSQmUg/TjFaXO8xSyI/AAAAAAAAAug/gSUxV2Zbh5w/s800/Drawing2.jpg" height="800" width="627" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-651024692757914214?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/651024692757914214/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/local-frametangent.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/651024692757914214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/651024692757914214'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/local-frametangent.html' title='三角面local frame上的tangent'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh3.googleusercontent.com/-8aeyJmSQmUg/TjFaXO8xSyI/AAAAAAAAAug/gSUxV2Zbh5w/s72-c/Drawing2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-2636958042360859422</id><published>2011-07-28T20:49:00.000+08:00</published><updated>2011-07-28T20:50:10.982+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='math series'/><title type='text'>两个向量的夹角</title><content type='html'>&lt;a href="https://picasaweb.google.com/lh/photo/SGM6e3witUGglryYzRdoZ6Naa-XtbnG49KUu8uq_aXg?feat=embedwebsite"&gt;&lt;img src="https://lh6.googleusercontent.com/-ApmLiiyPlis/TjFaUkjCgUI/AAAAAAAAAuc/OGgyxs4IsSg/s800/%2525E6%2525B3%252595%2525E5%252590%252591%2525E5%2525A4%2525B9%2525E8%2525A7%252592.jpg" height="354" width="604" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-2636958042360859422?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/2636958042360859422/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/blog-post_28.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2636958042360859422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2636958042360859422'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/blog-post_28.html' title='两个向量的夹角'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh6.googleusercontent.com/-ApmLiiyPlis/TjFaUkjCgUI/AAAAAAAAAuc/OGgyxs4IsSg/s72-c/%2525E6%2525B3%252595%2525E5%252590%252591%2525E5%2525A4%2525B9%2525E8%2525A7%252592.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1275025683442450270</id><published>2011-07-25T11:56:00.000+08:00</published><updated>2011-07-25T11:57:37.667+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='math series'/><title type='text'>不同local frame之间的角度值</title><content type='html'>&lt;a href="https://picasaweb.google.com/lh/photo/rzPTLWovR-5NJRNY6qSc2aNaa-XtbnG49KUu8uq_aXg?feat=embedwebsite"&gt;&lt;img src="https://lh3.googleusercontent.com/-2YB2Z4qodNQ/TizpUWcJdZI/AAAAAAAAAsU/aAh7xVY57Qg/s800/Transition%252520Func.jpg" height="479" width="623" /&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1275025683442450270?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1275025683442450270/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/local-frame.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1275025683442450270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1275025683442450270'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/local-frame.html' title='不同local frame之间的角度值'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh3.googleusercontent.com/-2YB2Z4qodNQ/TizpUWcJdZI/AAAAAAAAAsU/aAh7xVY57Qg/s72-c/Transition%252520Func.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3439788901473553200</id><published>2011-07-25T10:13:00.001+08:00</published><updated>2011-07-25T10:15:10.182+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='weekly update'/><title type='text'>weekly update</title><content type='html'>&lt;div&gt;- row-major vs. column-major, affine transform. some history, &lt;a href="http://fgiesen.wordpress.com/2011/05/04/row-major-vs-column-major-and-gl-es"&gt;http://fgiesen.wordpress.com/2011/05/04/row-major-vs-column-major-and-gl-es&lt;/a&gt; . &lt;/div&gt;&lt;div&gt;- a trip through the graphics pipeline 2011, &lt;a href="http://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index"&gt;http://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index&lt;/a&gt;/&lt;/div&gt;&lt;div&gt;- "Obligatory FXAA Post", what is AA/MSAA/MLAA (doing AA as a post-process, depth based)/FXAA (post-process, luminosity based technique)? 例如对FXAA最好的理解是你之前尝试过了其他AA方法并知道有什么问题然后去看新技术是否克服了旧问题;// "Image Space for Beginners" Render a Quad with the texture you want to do sth on, shader code. A distortion example with code.// "Moving beyond the Linear Bezier" linear, quadratic and bezier curve equations. level of continuity C0/C1/..., how to obtain a piecewise bezier with C1 continuity(meaning that the first derivative is continuously defined), how to obtain a cubic beizer curve that has C2 continuity with deBoor points.// "Little more theory with your mesh", Euler Characteristic, Closure/Link/Star of simplicial complex.  &lt;a href="http://jonmanatee.blogspot.com"&gt;http://jonmanatee.blogspot.com&lt;/a&gt;/ &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- book [A New Kind Of Science by Stephen Wolfram, 2002].&lt;/div&gt;&lt;div&gt;- [Procedural Textures Mapping using Geodesic Distance 2011]&lt;/div&gt;&lt;div&gt;- from twitter, ID_AA_Carmack John Carmack "I would like to use reference and const object fields more, but it can require awkward dances in initialization lists." 复习了有两种东西需要在初始化列表中完成初始化的.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3439788901473553200?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3439788901473553200/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/weekly-update_25.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3439788901473553200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3439788901473553200'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/weekly-update_25.html' title='weekly update'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1647161701530277624</id><published>2011-07-25T10:11:00.002+08:00</published><updated>2011-07-27T17:28:37.942+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='math series'/><title type='text'>三角形法向 - 两个frame之间的angle</title><content type='html'>&lt;a href="https://picasaweb.google.com/lh/photo/k2q4ogBvo-afZOxuwVyAh6Naa-XtbnG49KUu8uq_aXg?feat=embedwebsite"&gt;&lt;img src="https://lh4.googleusercontent.com/-QgtEyEqxPms/TizQPS_CXgI/AAAAAAAAAsA/InSgenHJu_g/s800/%2525E4%2525B8%252589%2525E8%2525A7%252592%2525E5%2525BD%2525A2%2525E6%2525B3%252595%2525E5%252590%252591.jpg" height="497" width="584" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://picasaweb.google.com/lh/photo/56unxiecHa4cr5OsCnA_SKNaa-XtbnG49KUu8uq_aXg?feat=embedwebsite"&gt;&lt;img src="https://lh4.googleusercontent.com/-7gnncvjOgRk/Ti_ZdRIf-nI/AAAAAAAAAuI/gdSJur-wiAY/s800/%2525E7%25259B%2525B8%2525E9%252582%2525BB%2525E4%2525B8%252589%2525E8%2525A7%252592%2525E9%25259D%2525A2%2525E7%25259A%252584%2525E5%25259D%252590%2525E6%2525A0%252587.jpg" height="759" width="800" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1647161701530277624?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1647161701530277624/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/blog-post_25.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1647161701530277624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1647161701530277624'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/blog-post_25.html' title='三角形法向 - 两个frame之间的angle'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh4.googleusercontent.com/-QgtEyEqxPms/TizQPS_CXgI/AAAAAAAAAsA/InSgenHJu_g/s72-c/%2525E4%2525B8%252589%2525E8%2525A7%252592%2525E5%2525BD%2525A2%2525E6%2525B3%252595%2525E5%252590%252591.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3179948856878892883</id><published>2011-07-20T17:24:00.000+08:00</published><updated>2011-07-20T18:55:52.435+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='math series'/><title type='text'>叉积的方向</title><content type='html'>&lt;a href="https://picasaweb.google.com/lh/photo/EoyRCMmtcBSH-kGT-ygkraNaa-XtbnG49KUu8uq_aXg?feat=embedwebsite"&gt;&lt;img src="https://lh4.googleusercontent.com/-bD8smM_LGis/Tiazwp5zfLI/AAAAAAAAArk/9EReTXLeTbQ/s800/Untitled.jpg" height="612" width="623" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3179948856878892883?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3179948856878892883/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/blog-post.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3179948856878892883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3179948856878892883'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/blog-post.html' title='叉积的方向'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh4.googleusercontent.com/-bD8smM_LGis/Tiazwp5zfLI/AAAAAAAAArk/9EReTXLeTbQ/s72-c/Untitled.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-8781733936907161916</id><published>2011-07-16T14:53:00.002+08:00</published><updated>2011-07-20T19:05:17.420+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='weekly update'/><title type='text'>weekly update</title><content type='html'>&lt;div&gt;- What is the OpenGL Context look like? A structure in C? An object is attached to a target (a pointer in C), then the state machine use the target to get and set the value of the object? &lt;a href="http://www.arcsynthesis.org/gltut/Basics/Intro%20What%20is%20OpenGL.html"&gt;http://www.arcsynthesis.org/gltut/Basics/Intro%20What%20is%20OpenGL.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- profiling. Mac上的shark比较流行，可惜在windows上没有. &lt;/div&gt; &lt;div&gt;Download Windows SDK, v7.1, to get the xperf application and play with it. &lt;/div&gt;&lt;div&gt;xperf &lt;a href="http://msdn.microsoft.com/en-us/performance/cc825801.aspx"&gt;http://msdn.microsoft.com/en-us/performance/cc825801.aspx&lt;/a&gt; and Process Explorer.&lt;/div&gt; &lt;div&gt;Debugging Tools for Windows (x64)&lt;/div&gt;&lt;div&gt;Microsoft Windows Performance Toolkit&lt;/div&gt;&lt;div&gt;Microsoft Windows SDK v7.1&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;a similar profiler from AMD &lt;a href="http://developer.amd.com/tools/CodeAnalyst/Pages/default.aspx"&gt;http://developer.amd.com/tools/CodeAnalyst/Pages/default.aspx&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- 继续看[Introduction to Linear Algebra]里面的subspace, column space, null space的概念。 &lt;/div&gt;&lt;div&gt;Column space contains all the right hand sides, in which case the Ax = b is solvable. The Null space N(A) contains all the solutions of Ax = 0.&lt;/div&gt; &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- 继续读[Scientific Computing: An Introductory Survey by Michael Heath]&lt;/div&gt;&lt;div&gt;1. 在书中解nonlinear equations system or optimization的例子时候终于知道跟linear system ( system of linear equations )的关系了, 用iterative methods解前者的问题时候每一步都迭代中很可能需要解一个线性方程组来得到下一步走向的信息. 例如在P158 5.2.3, Newton's Method for One dimension nonlinear equation: use a linear line to fit the curve at every step. &lt;/div&gt; &lt;div&gt;2. 怎么求解minimization of quadratic function/energy (which is quadratic object function without constraints)?, for example min||Bx - b||^2 -&amp;gt; f(x) = x^t*B^t*B*x - B^t*b*x -&amp;gt; A = B^t * B, a = B^t * b,&lt;/div&gt;&lt;div&gt; Ax=b, which A is spd, can be solved by conjugate gradient method. &lt;/div&gt; &lt;div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-8781733936907161916?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/8781733936907161916/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/weekly-update.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8781733936907161916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8781733936907161916'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/07/weekly-update.html' title='weekly update'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-5694003578090477482</id><published>2011-06-28T14:14:00.004+08:00</published><updated>2011-06-28T14:21:09.328+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bezier'/><category scheme='http://www.blogger.com/atom/ns#' term='random'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><category scheme='http://www.blogger.com/atom/ns#' term='equations'/><title type='text'></title><content type='html'>random number &lt;div&gt;--------- Possion disk sampling. &lt;div&gt;--------- Perlin Noise&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://devmag.org.za/2009/05/03/poisson-disk-sampling/"&gt;http://devmag.org.za/2009/05/03/poisson-disk-sampling/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://devmag.org.za/2009/04/25/perlin-noise/"&gt;http://devmag.org.za/2009/04/25/perlin-noise/&lt;/a&gt; &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://devmag.org.za/2011/06/25/implementing-and-debugging-the-perlin-noise-algorithm/"&gt;http://devmag.org.za/2011/06/25/implementing-and-debugging-the-perlin-noise-algorithm/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bezier curves&lt;/div&gt;&lt;div&gt;&lt;a href="http://devmag.org.za/2011/04/05/bzier-curves-a-tutorial/"&gt;http://devmag.org.za/2011/04/05/bzier-curves-a-tutorial/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://devmag.org.za/2011/06/23/bzier-path-algorithms/"&gt;http://devmag.org.za/2011/06/23/bzier-path-algorithms/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;近来遇到的问题是怎么求underdetermined systems, 以及minimize a quadratic energy, 我还是好像system of equation 跟 optimization是怎么联系在一起的. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-5694003578090477482?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/5694003578090477482/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/06/random-number-possion-disk-sampling.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5694003578090477482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5694003578090477482'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/06/random-number-possion-disk-sampling.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-4433739546436114484</id><published>2011-06-25T18:38:00.006+08:00</published><updated>2011-06-25T19:08:00.272+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphics memory'/><title type='text'>Graphics memory size</title><content type='html'>Sometimes, you may need to how many memory left, we can use the&lt;span class="Apple-style-span"&gt; GL_NVX_gpu_memory_info, the code snippet comes from the reference.&lt;/span&gt;&lt;br /&gt;&lt;pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt;#define GL_GPU_MEM_INFO_TOTAL_AVAILABLE_MEM_NVX 0x9048&lt;br /&gt;#define GL_GPU_MEM_INFO_CURRENT_AVAILABLE_MEM_NVX 0x9049&lt;br /&gt;   GLint total_mem_kb = 0;&lt;br /&gt;   glGetIntegerv(GL_GPU_MEM_INFO_TOTAL_AVAILABLE_MEM_NVX, &amp;amp;total_mem_kb);&lt;br /&gt;   GLint cur_avail_mem_kb = 0;&lt;br /&gt;   glGetIntegerv(GL_GPU_MEM_INFO_CURRENT_AVAILABLE_MEM_NVX,&amp;amp;cur_avail_mem_kb);&lt;br /&gt;   fprintf(stderr, "NV totoal mem %ikb, avail mem %ikb, used %ikb.\n", total_mem_kb, cur_avail_mem_kb, (total_mem_kb - cur_avail_mem_kb));&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-jE_OSd-82bw/TgW_bndRqxI/AAAAAAAAAqk/J7KNnWijJBM/s1600/Untitled1.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 97px;" src="http://3.bp.blogspot.com/-jE_OSd-82bw/TgW_bndRqxI/AAAAAAAAAqk/J7KNnWijJBM/s320/Untitled1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5622110191011080978" /&gt;&lt;/a&gt; &lt;div&gt;reference:&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.geeks3d.com/20100531/programming-tips-how-to-know-the-graphics-memory-size-and-usage-in-opengl/"&gt;http://www.geeks3d.com/20100531/programming-tips-how-to-know-the-graphics-memory-size-and-usage-in-opengl/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://www.tohtml.com/cpp/"&gt;http://www.tohtml.com/cpp/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://codeformatter.blogspot.com/2009/06/about-code-formatter.html"&gt;http://codeformatter.blogspot.com/2009/06/about-code-formatter.html&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-4433739546436114484?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/4433739546436114484/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/06/graphics-memory-size.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4433739546436114484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4433739546436114484'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/06/graphics-memory-size.html' title='Graphics memory size'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-jE_OSd-82bw/TgW_bndRqxI/AAAAAAAAAqk/J7KNnWijJBM/s72-c/Untitled1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-5452191745905400679</id><published>2011-04-18T10:10:00.003+08:00</published><updated>2011-04-19T16:47:57.628+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='math course'/><category scheme='http://www.blogger.com/atom/ns#' term='math series'/><category scheme='http://www.blogger.com/atom/ns#' term='course'/><title type='text'></title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Better Explained (learn right, not note)&lt;/div&gt;&lt;div&gt;&lt;a href="http://betterexplained.com/articles/vector-calculus-understanding-circulation-and-curl/"&gt;Vector Calculus: Understanding Gradient, Divergence, Flux, Circulation and Curl&lt;/a&gt;. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.math.umn.edu/~nykamp/m2374/readings/topicindex.html"&gt;Multivariable calculus and vector analysis&lt;/a&gt; (a set of on-line readings), by math.umn.edu/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.cs.caltech.edu/courses/cs177/lectures.html"&gt;Discrete Differential Geometry : Theory and Practice&lt;/a&gt;.  by cs.caltech.edu/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-5452191745905400679?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/5452191745905400679/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/04/better-explained-learn-right-not-note.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5452191745905400679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5452191745905400679'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/04/better-explained-learn-right-not-note.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-5966702271382287181</id><published>2011-04-07T10:27:00.003+08:00</published><updated>2011-04-07T10:30:47.176+08:00</updated><title type='text'>Tech Coord</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/-DmN5eNOxKvs/TZ0hYv216nI/AAAAAAAAAbQ/3V_AAXgwDME/s1600/TNCoord.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 640px; height: 392px;" src="http://3.bp.blogspot.com/-DmN5eNOxKvs/TZ0hYv216nI/AAAAAAAAAbQ/3V_AAXgwDME/s320/TNCoord.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5592663021311093362" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-5966702271382287181?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/5966702271382287181/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/04/tech-coord.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5966702271382287181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5966702271382287181'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/04/tech-coord.html' title='Tech Coord'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-DmN5eNOxKvs/TZ0hYv216nI/AAAAAAAAAbQ/3V_AAXgwDME/s72-c/TNCoord.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-7675148978349412250</id><published>2011-02-01T10:31:00.001+08:00</published><updated>2011-02-01T10:31:52.696+08:00</updated><title type='text'></title><content type='html'>阅读笔记&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Using hardware acceleration for graphics, on March 13, 2009&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Question 1: 给hardware分类.&amp;nbsp;&lt;/div&gt;&lt;div&gt;标准一: 是UnifiedMemoryArchitecture(UMA), 还是Dedicated graphics memoery(Non-UMA) ?&lt;/div&gt; &lt;div&gt;标准二: 根据graphics operations来分five categories.&lt;/div&gt;&lt;div&gt;于是一共十种类型types.&lt;/div&gt;&lt;div&gt;我们在PC上常见的都是Non-UMA + programmable-3D的.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Question 2: How can Qt off-load graphics operations to these different types of hardware?&amp;nbsp;&lt;/div&gt; &lt;div&gt;不同的hardware type有不同的rendering back end(QPaintEngine的具体实现):&lt;/div&gt;&lt;div&gt;Qt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;\ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; / QPaintEngine for type X:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| -- QPainter --| QPaintEngine for type Y: &amp;nbsp;&lt;/div&gt;&lt;div&gt;Application / &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; \ QPaintEngine for type Z:&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UMA &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Non-UMA&lt;/div&gt;&lt;div&gt;None &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Raster &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Raster*&lt;/div&gt;&lt;div&gt;Blitter &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DirectFB &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DirectFB**&lt;/div&gt;&lt;div&gt;2D vector &amp;nbsp; &amp;nbsp; &amp;nbsp; OpenVG*** &amp;nbsp; &amp;nbsp; &amp;nbsp; OpenVG***&lt;/div&gt;&lt;div&gt; Fixed-3D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OpenGL (ES) 1.x OpenGL (ES) 1.x&lt;/div&gt;&lt;div&gt;Programmable-3D&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;OpenGL (ES) 2.x OpenGL (ES) 2.x****&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;* When using raster on NUMA, rendering is actually done in system memory first, then flushed to VRAM&lt;/div&gt; &lt;div&gt;** This is the one which is going to be slow when doing anything other than QPainter::drawPixmap()&lt;/div&gt;&lt;div&gt;*** It shouldn&amp;rsquo;t be a big surprise we&amp;rsquo;re researching an OpenVG paint engine!&lt;/div&gt;&lt;div&gt;**** Qt 4.5 contains a new paint engine for OpenGL ES 2.x which we&amp;rsquo;re now making work on desktop OpenGL 2.0.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Qt Graphics and Performance &amp;ndash; An Overview, on December 16, 2009&lt;/b&gt;&lt;/div&gt;&lt;div&gt;关于QWidget and QWindowSurface:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;关于Graphics systems:&lt;/div&gt;&lt;div&gt;You can select graphics systems either by starting the application with the command line option -graphicssystem raster|opengl|opengl1|x11|native, where &amp;ldquo;native&amp;rdquo; means to use the system default. Another option is to provide the exact same option to configure which will set that option for all applications using Qt. Finally there is the function QApplication::setGraphicsSystem which hardcodes the graphics system for a given application.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;关于Images and Pixmaps:&lt;/div&gt;&lt;div&gt;The difference between these two is mostly covered in the documentation, but I would like to highlight a few things none the less.&lt;/div&gt;&lt;div&gt;Our documentation says: &amp;ldquo;QImage is designed and optimized for I/O, and for direct pixel access and manipulation, while QPixmap is designed and optimized for showing images on screen.&amp;rdquo;&lt;/div&gt; &lt;div&gt;这有点像Image跟Texture的区别, 后者可能是前者的封装加上一个OpenGL texture ID以便render.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Qt Graphics and Performance &amp;ndash; OpenGL, on January 6, 2010&lt;/b&gt;&lt;/div&gt;&lt;div&gt;什么是OpenGL, 为什么选择OpenGL ES 2.0?&lt;/div&gt;&lt;div&gt;QPainter将东西传给OpenGL来画, GL paint engine turn the whole of the QPainter API into &amp;quot;just a bouch of triangles&amp;quot;. 举了一个例子说明.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Interleaved Rendering：&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;void widget::paintEvent(QPaintEvent *)&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt; &amp;nbsp; &amp;nbsp;QPainter .... // 不同的painter来画.&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;QPainter .... //&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Mixing QPainter and Native OpenGL&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;QGLWidget vs OpenGL Graphics-System&amp;nbsp;&lt;/div&gt;&lt;div&gt;我看懂了OpenGL paint engine, 但是不懂OpenGL Graphics-System是什么概念, 为什么跟QGLWidget来比较, 后者全部东西都是用OpenGL paint engine来画, &amp;quot;all use the OpenGL paint engine regardless of what graphics system is being used. QGLWidget is basically a regular widget which always has a native window ID and is always rendered to using OpenGL. You are free to choose whichever method you want to get OpenGL rendering (graphics system or QGLWidget). However, using the opengl graphics system can often be slower than using a QGLWidget&amp;quot;. 是说我们App中可以选择用QGLWidget或者OpenGL graphics system? &amp;nbsp;&lt;/div&gt; &lt;div&gt;QGLWidget的缺点是不能局部sub-area更新, 需要重画整个widget.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-7675148978349412250?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/7675148978349412250/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/02/using-hardware-acceleration-for.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7675148978349412250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7675148978349412250'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/02/using-hardware-acceleration-for.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-4849741354560015448</id><published>2011-01-23T17:05:00.004+08:00</published><updated>2011-01-23T17:13:48.671+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='renderer'/><category scheme='http://www.blogger.com/atom/ns#' term='fractal'/><category scheme='http://www.blogger.com/atom/ns#' term='2d graphics'/><title type='text'></title><content type='html'>有些图案是artist随性的创作，有些是规律的，当中有对称的有pattern的，前者我做不了啦，后者倒是可以学学。&lt;br /&gt;下面是这两天收集的blogs.&lt;br /&gt;&lt;div&gt;------&lt;br /&gt;http://www.subblue.com/blog 上面很多用Pixel Bender做的fractal的效果, 他甚至"The images were rendered using a new fractal renderer I'm working on in Pixel Bender. I'll be releasing it once I'm happy with the final script."&lt;br /&gt;然后好奇地查了一下:&lt;br /&gt;&lt;br /&gt;Adobe &lt;span class="Apple-style-span" &gt;Pixel Bender&lt;/span&gt; Tookit 我理解为是Image Processing工具.&lt;br /&gt;Adobe Pixel Bender is a programming language that is used to create or manipulate image content. Using Pixel Bender you create a kernel, also known in this document as a shader. The shader defines a single function that executes on each of the pixels of an image individually.&lt;br /&gt;In Flash Player and Adobe AIR, three types of effects can be easily created using a shader: drawing fill, blend mode, filter.&lt;br /&gt;Note: Pixel Bender support is available starting in Flash Player 10 and Adobe AIR 1.5.&lt;br /&gt;&lt;br /&gt;ActionScript is the programming language for the Adobe Flash Player and Adobe AIR run-time environments. It enables interactivity, data handling, and much more in Flash, Flex, and AIR content and applications.&lt;br /&gt;&lt;br /&gt;他多次提到用了这里的技术&lt;span class="Apple-style-span" &gt;http://iquilezles.org/www&lt;/span&gt;/, http://iquilezles.org/www/articles/mandelbulb/mandelbulb.htm, http://iquilezles.org/www/articles/ssao/ssao.htm, 原来还有&lt;span class="Apple-style-span" &gt;http://iquilezles.org/prods/index.htm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;还提到一个不错的forum, http://www.fractalforums.com/3d-fractal-generation/true-3d-mandlebrot-type-fractal.&lt;br /&gt;-----------------&lt;br /&gt;另一blog&lt;br /&gt;http://blog.hvidtfeldts.net/index.php/2007/05/&lt;br /&gt;他的作品http://structuresynth.sourceforge.net/ &lt;span class="Apple-style-span" &gt;Structure Synth&lt;/span&gt; is a cross-platform application for generating 3D structures by specifying a design grammar. Even simple systems may generate surprising and complex structures. The design grammar approach was originally devised by Chris Coyne (for a 2D implementation see the popular Context Free Art).&lt;br /&gt;用语法grammar生成模型结构.&lt;br /&gt;http://www.contextfreeart.org/ &lt;span class="Apple-style-span" &gt;Context Free&lt;/span&gt; is a program that generates images from written instructions called a grammar. The program follows the instructions in a few seconds to create images that can contain millions of shapes.&lt;br /&gt;&lt;br /&gt;Context Free提到了用Anti-Grain Geometry(AGG)来做底层的2D graphics library. 原来AGG是很有名的2D rendering engine http://www.antigrain.com/about/index.html，Qt的2D Raster Engine在实现时候也考虑过AGG(http://labs.qt.nokia.com/2009/12/18/qt-graphics-and-performance-the-raster-engine/). AGG只是software rendering, 没有用到GL-based acceleration.&lt;br /&gt;&lt;br /&gt;Cairo is a 2D graphics library with support for multiple output devices (貌似也叫back ends). Currently supported output targets include the X Window System, Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, XCB, BeOS, OS/2, and DirectFB, 还有Qt等.&lt;br /&gt;&lt;br /&gt;Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. 3x3 matrices w/ perspective;antialiasing, transparency, filters;shaders, xfermodes, maskfilters, patheffects.&lt;br /&gt;New backend for GPUs:  There is a new library, sitting along side skia. Next to src/ and include/ is gpu/. This stand-along library is an abstraction for drawing 2D primitives to a GPU. GrContext.h is the header you should read first. Skia can use this to redirect 100% of its drawing to the GPU, via subclasses in src/gpu. SkGpuCanvas and SkGpuDevice.&lt;br /&gt;------&lt;br /&gt;http://processing.org/ 貌似是一种很popular的create images, animations, and interactions的open source programming language. 是基于Java的，文档倒是很清晰.&lt;br /&gt;还有几本本评价很高books，其一是:&lt;br /&gt;Processing: A Programming Handbook for Visual Designers and Artists [Hardcover].&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: 13.3333px; "&gt;&lt;br /&gt;------&lt;/span&gt;&lt;br /&gt;先学习一些math and formula, 生成一些经典的shape and fractal, 2D的话考虑用AGG/Cairo/Skia/Qt等来render比较方便, 3D的话当然需要用OpenGL来render.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-4849741354560015448?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/4849741354560015448/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/artistpattern-blogs.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4849741354560015448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4849741354560015448'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/artistpattern-blogs.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-4113529675898096643</id><published>2011-01-21T18:14:00.007+08:00</published><updated>2011-01-22T11:14:04.025+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uv'/><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><title type='text'></title><content type='html'>the main theme of this stage is bug fixing for me, but still sth can be learned from: &lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_3ksWOBRDci4/TTldBwzUuGI/AAAAAAAAAYE/Lef2avkk61Y/s1600/Untitled1.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 364px; height: 206px;" src="http://3.bp.blogspot.com/_3ksWOBRDci4/TTldBwzUuGI/AAAAAAAAAYE/Lef2avkk61Y/s400/Untitled1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5564581099454380130" /&gt;&lt;/a&gt;&lt;/div&gt;其中左边是一个(0,0) to (1,1)的方形square, 右边是一个(1,0) to (2,1)的方形square, 怎么判断三角形是在其中一个square里面，而不是跨过了两个squares呢，像那个红色的三角形? 运行三角形triangle刚好接触到两边界, 如那个大的green三角形. &lt;div&gt;下面只看横方向的坐标，纵向的Yaxis也类似：&lt;/div&gt;&lt;span&gt;&lt;span&gt;bool isCrossSquare = (int)start.x != (int)end.x;  错的. 因为int是四舍五入, int(-0.2) = 0. bool isCrossSquare = floor(start.x) != floor(end.x);  对的.&lt;/span&gt;&lt;/span&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;当然还得考虑特殊情况，像上面的大绿色三角形:&lt;/div&gt;&lt;div&gt;floor(start.x) = 0, floor(end.x) = 1, 但end.x == floor(end.x)表示右边压界，所以例外。&lt;/div&gt;&lt;div&gt;还得考虑横跨了两个square并刚好压界. &lt;/div&gt;&lt;div&gt;完整的判断是:&lt;/div&gt;&lt;div&gt;bool isCrossSquare = (floor(start.x) != floor(end.x) &amp;amp;&amp;amp; end.x != floor(end.x)) || (end.x - start.x &gt; 1);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: 15px;"&gt;其中一个应用实例是判断uv layout有没有超出范围. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-4113529675898096643?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/4113529675898096643/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/main-theme-of-this-stage-is-bug-fixing.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4113529675898096643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4113529675898096643'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/main-theme-of-this-stage-is-bug-fixing.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_3ksWOBRDci4/TTldBwzUuGI/AAAAAAAAAYE/Lef2avkk61Y/s72-c/Untitled1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1006885612417737522</id><published>2011-01-20T21:26:00.007+08:00</published><updated>2011-01-20T22:53:08.493+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='texturing'/><category scheme='http://www.blogger.com/atom/ns#' term='filter'/><category scheme='http://www.blogger.com/atom/ns#' term='box filter'/><title type='text'></title><content type='html'>今天有看到box filter这名词了, ptex的paper中提到用box filter做symmetric reductions of each texture(also use asymmetric reduction for anisotropic filtering), 于是又想回顾一下这些概念. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;什么是filter (filter kernel)? hint: a pattern. &lt;/div&gt;&lt;div&gt;什么是convolution? 什么是image filtering?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Box filter这里的box好像是指这个filter的形状shape, 例如3*3, 而像Bicubic  filter这filter的shape在一维来看是曲线，二维来看估计是圆形. (可能用box filter来跟bicubic filter来做比较不是十分合适，我的理解中box filter好像是指一类filter，只要它们的shape都是rectangle, 而bicubic filter好像是特地的一种, 但又可能不是，因为bicubic函数系数不一样得到的curve是不一样的？)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Box filter是系数都是positive, 于是起到的是模糊smooth的效果，而Bicubic filter的系数weight中山有negative的，于是能起到a slight sharpening effect. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;在GPU中实现时候为了避免bicubic的计算，可以用look-up table的方法(在CPU中建float-precision texture). 具体看[1]. &lt;/div&gt;&lt;div&gt;Reference: &lt;/div&gt;&lt;div&gt;[1] High-Quality Filtering &lt;span class="Apple-style-span" style="font-size: 13.3333px; "&gt;&lt;a href="http://http.developer.nvidia.com/GPUGems/gpugems_ch24.html"&gt;http://http.developer.nvidia.com/GPUGems/gpugems_ch24.html&lt;/a&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;下面是对box filter和bilinear filter的感性区别, box filter是求中间11号texel时候用包括自身在内的9个texel做平均(也可以理解为系数固定的线插interpolation)， 而bilinear filter是图片放大or缩小or大小不变但是错位时候求自身texel时候对最近的4个做线插, 线插的系数跟自身texel离那4个texels的距离有关, bilinear filter常见于OpenGL (or GPU hardware) interpolation(texture filtering), 例如在magnification情况下一个texel占了多个pixels, 那每一pixel的color就找最近的4个Texels用bilinear interpolation，这类似于把image缩小，小的image的一个texel相当于在大的image的多个texel的线插&lt;span class="Apple-style-span" style="font-size: 13.3333px; "&gt;. &lt;/span&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_3ksWOBRDci4/TThIsKDaVqI/AAAAAAAAAX8/EcwBqlW5acw/s1600/Untitled1.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 197px;" src="http://1.bp.blogspot.com/_3ksWOBRDci4/TThIsKDaVqI/AAAAAAAAAX8/EcwBqlW5acw/s400/Untitled1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5564277263066355362" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1006885612417737522?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1006885612417737522/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/box-filter-ptexpaperbox-filtersymmetric.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1006885612417737522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1006885612417737522'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/box-filter-ptexpaperbox-filtersymmetric.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_3ksWOBRDci4/TThIsKDaVqI/AAAAAAAAAX8/EcwBqlW5acw/s72-c/Untitled1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3522415798974868926</id><published>2011-01-18T20:22:00.001+08:00</published><updated>2011-01-18T21:04:25.301+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='paper'/><category scheme='http://www.blogger.com/atom/ns#' term='quad'/><title type='text'></title><content type='html'>&lt;a href="http://www.disneyanimation.com/library/motorcycle_sgp_2008.pdf"&gt;Motorcycle Graphs: Canonical Quad Mesh Partitioning&lt;/a&gt;.(摩托车图: 标准的四边形网格剖分:-)&lt;br /&gt;A mesh is &lt;i&gt;&lt;span class="Apple-style-span"&gt;structured&lt;/span&gt;&lt;/i&gt; if it has no extraordinary vertices, and unstructured otherwise. The main subjects of this paper are structured partitions in which the quadrilaterals of a mesh (&lt;i&gt;&lt;span class="Apple-style-span"&gt;semi-regular&lt;/span&gt;&lt;/i&gt; mesh) are partitioned into a small number of structured submeshes.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Extraordinary vertices都是作为分界点, 假如user先选择两个extraordinary vertices然后连在一起，是不是会加快计算呢?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3522415798974868926?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3522415798974868926/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/motorcycle-graphs-canonical-quad-mesh.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3522415798974868926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3522415798974868926'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/motorcycle-graphs-canonical-quad-mesh.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-6031285693120241976</id><published>2011-01-18T15:37:00.004+08:00</published><updated>2011-01-18T17:56:32.602+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='renderer'/><title type='text'></title><content type='html'>These are examples and resources about renderer:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ray Tracing:&lt;/div&gt;&lt;div&gt;YafaRay: .&lt;/div&gt;&lt;div&gt;LuxRender: original based on PBRT in 2007.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Physically Based Rendering, Second Edition: From Theory To Implementation by Matt Pharr.&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.raytracegroundup.com/index.html"&gt;Ray Tracing from the Ground Up&lt;/a&gt; by Kevin Suffern. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;RenderMan compliant renderers:&lt;/div&gt;&lt;div&gt;&lt;a href="http://renderman.pixar.com/"&gt;Pixar RenderMan&lt;/a&gt;(PRman): RiSpec, the RenderMan Interface Specification. It is built around the REYES algorithm.  The popular shading language is RSL developed by Pixar.  &lt;a href="http://code.google.com/p/openshadinglanguage/"&gt;OSL&lt;/a&gt; released by Sony is another story(check the &lt;a href="http://openimageio.org/"&gt;OpenImageIO&lt;/a&gt; too). &lt;/div&gt;&lt;div&gt;&lt;a href="http://www.aqsis.org/"&gt;Aqsis&lt;/a&gt;: Open source 3D solution  adhering to the RenderMan interface standard by Pixar Animation Studios.&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.blogger.com/www.renderpixie.com"&gt;Pixie&lt;/a&gt;, a bit like a dead project since 2005.&lt;/div&gt;&lt;div&gt;3Delight, 6 months of free license. &lt;/div&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_3ksWOBRDci4/TTVVc__XV3I/AAAAAAAAAXg/TPrDdAAcxeM/s1600/Untitled.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 146px;" src="http://2.bp.blogspot.com/_3ksWOBRDci4/TTVVc__XV3I/AAAAAAAAAXg/TPrDdAAcxeM/s400/Untitled.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5563446871388018546" /&gt;&lt;/a&gt;&lt;div&gt;From this pic, RenderMan is just an API to communicate with renderers(RenderMan is not a renderer, it is an interface description. But often renderman is used as a synonym for the render PRman itself). There are two main parts of RenderMan: 3D scene description language(.rib, RenderMan Interface Bytestream), and Programable shading language(.sl). &lt;a href="http://www.popup-studio.com/repository/Introduction_to_RenderMan.pdf"&gt;Introduction to PRman&lt;/a&gt;. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-6031285693120241976?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/6031285693120241976/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/these-are-examples-and-resources-about.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/6031285693120241976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/6031285693120241976'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/these-are-examples-and-resources-about.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_3ksWOBRDci4/TTVVc__XV3I/AAAAAAAAAXg/TPrDdAAcxeM/s72-c/Untitled.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-7327219446694802568</id><published>2011-01-17T21:00:00.002+08:00</published><updated>2011-01-17T22:11:00.890+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mipmap'/><category scheme='http://www.blogger.com/atom/ns#' term='texturing'/><category scheme='http://www.blogger.com/atom/ns#' term='virtual texturing'/><category scheme='http://www.blogger.com/atom/ns#' term='paper'/><title type='text'></title><content type='html'>These are some of the papers and resources related to virtual texturing:&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://anteru.net/2008/07/25/242/" style="font-family: Verdana; font-size: 11.6667px; "&gt;http://anteru.net/2008/07/25/242/&lt;/a&gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-style-span" style="font-size: 11.6667px;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; font-family: Verdana; font-size: 11.6667px; "&gt;&lt;a href="http://www.pcper.com/article.php?aid=532&amp;amp;type=overview"&gt;http://www.pcper.com/article.php?aid=532&amp;amp;type=overview&lt;/a&gt; &lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; font-family: Verdana; font-size: 11.6667px; "&gt;&lt;a href="http://en.wikipedia.org/wiki/MegaTexture"&gt;http://en.wikipedia.org/wiki/MegaTexture&lt;/a&gt;  &lt;/div&gt;&lt;br /&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; font-family: Verdana; font-size: 11.6667px; "&gt;还有GigaVoxel&lt;/div&gt;&lt;a href="http://artis.imag.fr/Publications/2009/CNLE09/" id="trcl" title="GigaVoxels : Ray-Guided Streaming for Efficient and Detailed Voxel Rendering" style="font-family: Verdana; font-size: 11.6667px; "&gt;GigaVoxels : Ray-Guided Streaming for Efficient and Detailed Voxel Rendering&lt;/a&gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-style-span" style="font-size: 11.6667px;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; font-family: Verdana; font-size: 11.6667px; "&gt;&lt;a href="http://artis.imag.fr/Publications/2009/CNLSE09/" id="ftsf" title="Beyond Triangles : GigaVoxels Effects In Video Games"&gt;Beyond Triangles : GigaVoxels Effects In Video Games&lt;/a&gt;   &lt;/div&gt;&lt;span class="Apple-style-span"  style="font-family: Verdana; font-size: 11.6667px; "&gt;&lt;a href="http://www.icare3d.org/" style="color: rgb(46, 75, 143); text-decoration: none; "&gt;http://www.icare3d.org&lt;/a&gt;   相关的东西。&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-style-span" style="font-size: 12px;"&gt;&lt;br /&gt;google: a sparse voxel octree data structure &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; font-family: Verdana; font-size: 11.6667px; "&gt;&lt;span class="Apple-style-span" &gt;&lt;a href="http://en.wikipedia.org/wiki/MegaTexture"&gt;http://www.tomshardware.com/reviews/voxel-ray-casting,2423-5.html&lt;/a&gt; The advantage of sparse voxel octrees.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; font-family: Verdana; font-size: 11.6667px; "&gt;&lt;span class="Apple-style-span" &gt;&lt;a href="http://raytracey.blogspot.com/2008/08/voxel-ray-tracing-vs-polygon-ray.html"&gt;http://raytracey.blogspot.com/2008/08/voxel-ray-tracing-vs-polygon-ray.html&lt;/a&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; "&gt;&lt;span class="Apple-style-span"  &gt;&lt;span class="Apple-style-span" style="font-size: 12px;"&gt;Efficient sparse voxel octrees, NVIDA在google code上提供cuda实现.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 11.6667px; "&gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Andreas Neu, Bachelor Thesis, Virtual Texturing, April 2010;&lt;/div&gt;&lt;div&gt;Albert Julian Mayer, Vertual Texturing, http://www.cg.tuwien.ac.at/research/publications/2010/Mayer-2010-VT/Mayer-2010-VT-Paper.pdf;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-7327219446694802568?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/7327219446694802568/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/these-are-some-of-papers-and-resources.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7327219446694802568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7327219446694802568'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2011/01/these-are-some-of-papers-and-resources.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-2612130183505640208</id><published>2010-12-29T17:57:00.002+08:00</published><updated>2010-12-29T18:03:18.762+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='胡思乱想'/><title type='text'></title><content type='html'>突然觉得计划生育的原因，害得没有了所谓的家族几代的概念（可能我太传统了，觉得家族的延伸需要男ding）。那一个家庭的生意和事业怎么延伸呢? &lt;div&gt;A家的事业，传给了C，C是A的女人or外孙，C是B家的媳妇or孙子，那往后的事业不就成了B家的吗？&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-2612130183505640208?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/2612130183505640208/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/12/ding-accaorcborb.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2612130183505640208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2612130183505640208'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/12/ding-accaorcborb.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-5473585643292508808</id><published>2010-12-29T11:18:00.004+08:00</published><updated>2011-01-07T21:52:27.678+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='指令集'/><category scheme='http://www.blogger.com/atom/ns#' term='CPU'/><title type='text'></title><content type='html'>&lt;div&gt;吴军的浪潮之巅 - Intel&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_3ksWOBRDci4/TRqotqnV9BI/AAAAAAAAAXI/nBh66DTWfRk/s1600/Untitled.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 600px; height: 240px;" src="http://4.bp.blogspot.com/_3ksWOBRDci4/TRqotqnV9BI/AAAAAAAAAXI/nBh66DTWfRk/s400/Untitled.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5555938592801813522" /&gt;&lt;/a&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_3ksWOBRDci4/TRqotqnV9BI/AAAAAAAAAXI/nBh66DTWfRk/s1600/Untitled.png"&gt;&lt;/a&gt;&lt;span class="Apple-style-span"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;2011/1/7 update 近来看到news说Microsoft的windows做ARM cpu的版本了。查了一下ARM，原来可以理解为一个公司名or一种CPU架构，于是CPU的架构包括了intel's x86, ARM, IBM's POWER(PowerPC缘由POWER体系架构)等. 其中ARM和Power都是RISC的，而Linux支持CISC和RISC指令集。&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;于是来了一个问题，OS是怎么支持某种指令集的呢？&lt;/div&gt;&lt;div style="text-align: left;"&gt;OS or other program -&gt; compile to be object file-&gt; link to be execution.&lt;/div&gt;&lt;div style="text-align: left;"&gt;Compile的过程在预编译 词法语法分析得到汇编时候就考虑RISC/CISC?&lt;/div&gt;&lt;div style="text-align: left;"&gt;还是汇编代码--&gt;机器指令这这时候才考虑RISC/CISC?&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;reference:&lt;/div&gt;&lt;div style="text-align: left;"&gt;[1]&lt;/div&gt;&lt;div style="text-align: left;"&gt;[2] &lt;span class="Apple-style-span" style="font-size: 13.3333px; "&gt;&lt;a href="http://www.ibm.com/developerworks/cn/linux/l-powhist/"&gt;http://www.ibm.com/developerworks/cn/linux/l-powhist/&lt;/a&gt; 人类的POWER IBM芯片制造史 &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-size: 13.3333px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-size: 13.3333px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-5473585643292508808?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/5473585643292508808/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/12/intel.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5473585643292508808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5473585643292508808'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/12/intel.html' title=''/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_3ksWOBRDci4/TRqotqnV9BI/AAAAAAAAAXI/nBh66DTWfRk/s72-c/Untitled.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3603562959379922030</id><published>2010-09-13T09:36:00.000+08:00</published><updated>2010-09-13T09:38:04.082+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mask'/><category scheme='http://www.blogger.com/atom/ns#' term='l-value'/><category scheme='http://www.blogger.com/atom/ns#' term='weekly update'/><category scheme='http://www.blogger.com/atom/ns#' term='shader'/><category scheme='http://www.blogger.com/atom/ns#' term='layer'/><category scheme='http://www.blogger.com/atom/ns#' term='rgb'/><category scheme='http://www.blogger.com/atom/ns#' term='r-value'/><category scheme='http://www.blogger.com/atom/ns#' term='hsl'/><category scheme='http://www.blogger.com/atom/ns#' term='pointer'/><category scheme='http://www.blogger.com/atom/ns#' term='hsv'/><title type='text'>Weekly update 2010/9/6~</title><content type='html'>&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;img src="https://docs.google.com/drawings/image?id=sCToHDM7FXUBY9RMmdb-ewQ&amp;amp;w=615&amp;amp;h=284&amp;amp;rev=166&amp;amp;ac=1" width="615px;" height="284px;" id="internal-source-marker_0.9100213320925832" /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/HSL_and_HSV"&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://en.wikipedia.org/wiki/HSL_and_HSV&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.manifold.net/doc/colors_as_hue_saturation_and_brightness.htm"&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://www.manifold.net/doc/colors_as_hue_saturation_and_brightness.htm&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;讲述GUI的history，&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;也是发展了2/30年嘛. keyword: xerox, windows, mac.&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.gladdengraphics.com/academics/GradCourses/ComputerGraphicsHistory/ResearchPaper/parcgui01.pdf"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://www.gladdengraphics.com/academics/GradCourses/ComputerGraphicsHistory/ResearchPaper/parcgui01.pdf&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;There is a case that pointer is needed. for example,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;class GLSLShaderProgram {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;public:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;GLSLShaderProgram *createInstanceFromSource(vs string, fs string);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;protected:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;GLSLShaderProgram(...);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;}; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;In this case, we cannot define something like this:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;class App {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;public:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;App(): ... {}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;private:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;GLSLShaderProgram m_programHandle;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;};&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Because the m_programHandle will be initialized in the initialization list with constructor, which is not available from outside.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;后来我才意识到:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;shading effect = lighting + material of geometry.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;而shading shader 就是那个”+”加号, 根据特定的shading stype来计算.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;所以GLSLShadingProgram不该直接放到App里面, 而是例如:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;而且具体的某一个shading shader 就是用于某一种shading effect的.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;class App {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;PhongShading m_phong;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;};&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;class PhongShading {&lt;/span&gt;&lt;br /&gt;&lt;p style="text-indent: 36pt; margin-top: 0pt; margin-bottom: 0pt; "&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;bool initialize() {&lt;/span&gt;&lt;/p&gt;&lt;p style="text-indent: 36pt; margin-top: 0pt; margin-bottom: 0pt; "&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;m_programHandle = createProgramFromFile(phong.glsl);&lt;/span&gt;&lt;/p&gt;&lt;p style="text-indent: 36pt; margin-top: 0pt; margin-bottom: 0pt; "&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;return m_programHandle != 0;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-indent: 36pt; margin-top: 0pt; margin-bottom: 0pt; "&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;}&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;GLSLShadingProgram m_programHandle;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;};&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;class Model {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;void render() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;get m_phong from app;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;set the lighting and material parameters;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;active the shading program to draw the model;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;};&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;How the &lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(153, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;mask &lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;is effecting on a image layer?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Blend mode 用于有一个background image, 当上面加一个image做blending and composing时候用的。&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Masks是附加于a specified image layer, 不修改影响那个image layer本身(un-destructive), 只是觉得那些pixel可以透过mask被看到, 那些被遮挡了不能看到.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Shader中是怎么实现的呢?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Verdana; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;What is the l-value and r-value, difference?&lt;/span&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/vcblog/archive/2009/02/03/rvalue-references-c-0x-features-in-vc10-part-2.aspx"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://blogs.msdn.com/b/vcblog/archive/2009/02/03/rvalue-references-c-0x-features-in-vc10-part-2.aspx&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3603562959379922030?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3603562959379922030/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/09/weekly-update-201096.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3603562959379922030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3603562959379922030'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/09/weekly-update-201096.html' title='Weekly update 2010/9/6~'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-8042914970568712528</id><published>2010-08-31T21:52:00.003+08:00</published><updated>2010-08-31T22:11:51.457+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='weekly update'/><category scheme='http://www.blogger.com/atom/ns#' term='camera'/><category scheme='http://www.blogger.com/atom/ns#' term='qt'/><category scheme='http://www.blogger.com/atom/ns#' term='ui'/><category scheme='http://www.blogger.com/atom/ns#' term='tree'/><title type='text'>Weekly update 2010/8/23-29</title><content type='html'>跟UI打交道的一周.&lt;br /&gt;&lt;br /&gt;Qt Model/View architecture:&lt;br /&gt;Model: QModelIndex, internalPainter is used to associate the custom item pointer to the QModelIndex, the custom item class is defined by us and is used to store the custom data.&lt;br /&gt;View: there are mouse press/release/doubleclick/move event, the row and tree branches(grew lines) can be redraw by overriding drawRow/drawBranches function.&lt;br /&gt;&lt;br /&gt;Others:&lt;br /&gt;&lt;br /&gt;1.   之前假如不是跟geometry/mesh相关的工作，我都有一点点抵触, 觉得不对口。现在发觉不能这样子，想做跟geometry/mesh相关的工作内容是因为想在那方面做深入, 但是有时候做做别的东西也能扩展知识面, 而且东西都不是独立而是相联系的。例如现在在看Qt的model/view architecture, 从pattern从编程方面都是会有益的。例如做paint layer blend mode, paint layer transfer, layer mask就能扩展texture/material这方向的认识。&lt;br /&gt;&lt;br /&gt;2.   写代码，接触一个feature甚至是fix 一个bug时候，一定要进行做的完善完美鲁棒, 否则之后的bugs会不断过来，弄得无法开始or专心于下一步的工作。&lt;br /&gt;&lt;br /&gt;3.   要到LayerModel/LayerView(custom 的Model/View)中加入新的model item, 而且这些item还是新的类型, 于是觉得：冷静-&gt;逻辑清晰-&gt;快速的理解能力很重要.&lt;br /&gt;&lt;br /&gt;4.   想起了去年面试被问过的一个question: 给出三角形的三个边长, 怎么求出三角形的面积?&lt;br /&gt;假如在初高中时候要是这个问题都不懂的话肯定考不上大学，如今却真的模糊了。后来复习时候发现那个公式原来有个不错的名字Heron’s (or Hero’s) formula. A=sqrt(s*(s-a)*(s-b)*(s-c)), where s = (a+b+c)*0.5, http://en.wikipedia.org/wiki/Heron's_formula, 链接中还给出了利用余弦定理law of cosines的证明(这个更重要). 这些其实都是应该牢记的。最后提到了这个公式的数学稳定性不好numerically unstable, http://en.wikipedia.org/wiki/Numerical_stability, 里面对一个array 求sum的例子不错, 求一百个数, 假如一个是1，另外99个都是0.01，精确解释1.99，但是看上去正确的算法得到的结果不同，有些甚至是错误的(错误的是先加1再加0.01, 较好的做法是先排序, 从小到大来加. 排序?复习)。这可能是2进制计算机中由于round-off error and truncation error而引入的 (ok, 又涉及到了floating point numer了, 怎么表示，跟0的比较，之前看过一个用它生成random number的)。&lt;br /&gt;然后又从truncation提到了Taylor series (这个我在研二暑假找实习时候被问及), 除了能写出这个公式之外，还得想想它有什么实际用处. (1). F(x) = F(a) + F’(a)x +…当 a=0时候就变为Maclaurin series, 然后就可以求例如the exponential function e^x的近似值了, sin(x)的近似值等。&lt;br /&gt;&lt;br /&gt;5.   有这么一个Camera model, 有意思的是我想在初始化时候都是给出position, target等参数parameters, 但是这个camera model中确实根据给出的scene center and scene radius来计算那些参数.&lt;br /&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: Simsun; font-size: medium; "&gt;&lt;img src="https://lh5.googleusercontent.com/NMoFNdSV3e7c6MJ0ZGL6Uch0lxpOdcFT6YZw9vpQsVM5WdPGuJvip1erR1WwDeQEBAMXO7kUht9vEZQsLfnA0Ef1W3nDqto5EtrQ77s4xvidZOkrug" width="655px;" height="214px;" id="internal-source-marker_0.3350982991978526" /&gt;&lt;/div&gt;6.    Tree data structure.&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;for example, max-heap is a complete binary tree, which used to build the priority-queue;&lt;/div&gt;&lt;div&gt;the RB-tree is binary search tree, which is used to build the set and map container.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;there are many other examples of course. scene tree...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-8042914970568712528?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/8042914970568712528/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/weekly-update-2010823-29.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8042914970568712528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8042914970568712528'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/weekly-update-2010823-29.html' title='Weekly update 2010/8/23-29'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1930088973302777485</id><published>2010-08-22T18:03:00.002+08:00</published><updated>2010-08-22T18:07:34.733+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='application'/><title type='text'>add model list</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"   style="  ;font-family:'Times New Roman';font-size:medium;"&gt;&lt;img src="https://lh3.googleusercontent.com/V7UXh84R2mWrnXQBq-8S-nUeeEFy0WNbUOcu9BPfxNnvK5kNV7kFHBkAPa91-jpL2FLiJMQ2SyJvlviHyqe9AGPfZ9MOJpDZEkAAieXWsWJf4VNjvQ" width="602px;" height="359px;" id="internal-source-marker_0.06734590791165829" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1930088973302777485?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1930088973302777485/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/add-model-list.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1930088973302777485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1930088973302777485'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/add-model-list.html' title='add model list'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3485278512051919773</id><published>2010-08-20T18:58:00.002+08:00</published><updated>2010-08-21T13:24:22.079+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='curvature'/><category scheme='http://www.blogger.com/atom/ns#' term='weekly update'/><category scheme='http://www.blogger.com/atom/ns#' term='vertex batch'/><category scheme='http://www.blogger.com/atom/ns#' term='shader'/><category scheme='http://www.blogger.com/atom/ns#' term='book'/><title type='text'>Weekly update - 2010/8/16</title><content type='html'>&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;span id="internal-source-marker_0.6427995897829533" style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Basic shader manager and vertex batch&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;There are many things to learn and do. In order to render the curvature tensor, which is property of mesh, i need to add shader step-up and organize the vertices from curvatures into vbo (OpenGL 3.x is used). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;However, there is already shader step-up and vbo using in the scene::render(), i don’t want to duplicate the code in the class Model. So, shader manager and vertex batch classes are need.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;After googling, i come across to &lt;/span&gt;&lt;a href="http://www.informit.com/articles/article.aspx?p=1616796&amp;amp;seqNum=4"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://www.informit.com/articles/article.aspx?p=1616796&amp;amp;seqNum=4&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;, the free chapters of OpenGL SuperBible 5th, and the greatest thing is its code is stored in google code project, from where i can download it. Must read! &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Another resource is &lt;/span&gt;&lt;a href="http://prideout.net/blog/?p=22"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://prideout.net/blog/?p=22&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt; (anti-aliased cel shading, and shader wrapper).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Expected result:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;1. Refactor the shader loading, create the batch class, render the scene(world frame, grid, mesh) using this new one. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;2. render the curvature tonsor.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;3. integrate the anti-aliased cel shading. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Notes:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;1. there are two ways to get the vertex attribute location(index). The explicit way, use the &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;glBindAttribLocation(uint program, int index, char *name);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;The inexplicit way, use the &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;int index = glGetAttribLocation( uint program, const char *name );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;the index will be used later by puting vertex data into it. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;2. To render the model, there is only mesh data at the current time, which is a polygon/n-sided mesh, using GL_TRIANGLES, a triangle mesh is created. The triangle mesh is used exclusively on rendering, but the mesh adjacency information is not used so data is wasted to record that. After integrate the GLBatch from GLTools of OpenGL SuperBible 5th, I wonder how about remove the triangle mesh, put the triangle data of the polygon mesh into the a instance of class GLBatch. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;After further investigation, it is found that there is no index buffer object in the class GLBatch, for example if a quad is needed to be drew, six vertices are needed, and the &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;glDrawArray(GL_TRIANGLES, 0, 6); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;is used. There are two vertices are duplicated. The GLBatch cannot be used directly.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;But the triangle mesh is still needed to be removed. I want to create a vertex batch for all the vertices data, and create two index buffer object, one for regularly drawing triangle(GL_TRIANGLES) and one for drawing polygon wireframe(GL_LINES). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;2010/8/17&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Curvature tonsor&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;img src="https://lh3.googleusercontent.com/VEfkgFYuLaZLNwu8FxPWjSrLhXUuEbXLk9IVxO-CWpMCZt6OhOCDQjW7wduoM6ewuKohfOPEruLf6YNs7Q6BFEm6drHwrExVmoulXHHdC_ZglfTxfg" width="363px;" height="190px;" /&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;The principal curvature directions (red line for KMax, green line for KMin) are renderred using the the flat shader of the stock shaders in GLTools/GLShadermanager.h/cpp. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;To build up the 3*3 tensor matrix (used by the Normal Cycle approximation algorithm), need to loop and search a neighborhood region of a start vertex. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;push the start vertex into a stack (why use stack);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;while stack is not empty&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;v = pop up the top vertex;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;loop the one-ring neighbor of v;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;if the neighbor meets the qualify, operate on it and push it into stack.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;This search algorithm remind me of the Dijkstra’s algo. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;To improve the curvature quality, some smoothing steps are need.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Triangle is evil?&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Doing with mesh, i always asking why the quad mesh is used so often and i saw most of the model created by so-called artist are quad mesh, not triangle mesh, not even the n-sided mesh.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Maybe, this is one of the reason.&lt;/span&gt;&lt;img src="https://docs.google.com/drawings/image?id=svspqMGxLqIy5DEUxfHoMZw&amp;amp;w=618&amp;amp;h=154&amp;amp;rev=141&amp;amp;ac=1" width="618px;" height="154px;" /&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;(a). Two quad faces share one edge, it is easy to set these two faces are symmetric.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;(b). Tessellate those two faces in (a) into triangles, what happen the red triangles are set to symmetric? It’s wrong i guess, the topology are not symmetric, though the vertices are symmetric.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;(c). even worse.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Thinking about managing ImageFilter/MeshBrush &lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;img src="https://lh6.googleusercontent.com/zHit7ovqlxdbbeINB-EFh_2eObLUInv2CrN0hT0z4shRTNnPbAJLMnd0mcZgy5TG9Ps3Jbti43J172XRbzki8rM1GmaIKeZXb8DGeqevvOXzV9eHRw" width="572px;" height="306px;" /&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;In the plugin “Image Filter Tool”, there are some image filters can be applied to the image. There is a base class ImageFilter, i can write derive class of it in another plugin(dll) to define new image filter. My question is after the new image filter type is defined, how to add it into the main application, and create ui(for example button, or combo item) for it?&lt;/span&gt;&lt;img src="https://docs.google.com/drawings/image?id=srB7bsuDMbU8qDDuBwMpTiA&amp;amp;w=619&amp;amp;h=389&amp;amp;rev=264&amp;amp;ac=1" width="619px;" height="389px;" /&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;The function registerImageFilters(...) can be put into a ImageFilterFactory class as a static member functon:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;typedef (ImageFilter *)(FuntionPointer)();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;void ImageFilterFactor::registerImageFilter(string name, FuntionPointer funcPointer);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Can it be better? &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;(1). do not create the instance until the filter is selected.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;(2). do not use the callback function to create the instance in plugin, but use running time type info(rtti) to create a instance in the main application. Declare a new image filter like this:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;class ImageFilter : public XObject {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;X_OBJECT &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;};&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;in plugin:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;class XImageFilter: public ImageFilter {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;X_OBJECT&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;}; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Something looks like the object system in Qt :-) then the XImageFilter type is added into the object system, later we can check whether we have a type named “XImageFilter” in the object system, if yes, we use:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;ClassInfo * findClassInfo(“XImageFilter”);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;ImageFilter *pIF = pCI-&gt;createInstance();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Recommended book&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;: Design of Design &lt;/span&gt;&lt;a href="http://www.informit.com/store/product.aspx?isbn=0201362988"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://www.informit.com/store/product.aspx?isbn=0201362988&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt; sample chapters are on the right hand side.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;(some one said “Run, you run” can be translated into 跑啊, 你丫快跑啊:-)&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3485278512051919773?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3485278512051919773/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/weekly-update-2010816.html#comment-form' title='1 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3485278512051919773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3485278512051919773'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/weekly-update-2010816.html' title='Weekly update - 2010/8/16'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-7068559639853207505</id><published>2010-08-20T18:57:00.000+08:00</published><updated>2010-08-20T18:58:24.594+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bug series'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><title type='text'>Bug Series - angle between two vectors</title><content type='html'>&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;span id="internal-source-marker_0.6005533458665013" style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;float dot = dot(v0, v1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;float radian = acos(dot);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;more safe:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;dot = Max(-1, Min(dot(v0, v1), 1); // make sure the dot is [-1, 1].&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;radian = acos(dot);&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; "&gt;&lt;span style="background-color: transparent; vertical-align: baseline; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; white-space: pre-wrap;"&gt;https://docs.google.com/document/pub?id=1KyKbHUXfrXh-7L0g4cP-l2QcqVDsmYPTyBJXjGAtXhA&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-7068559639853207505?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/7068559639853207505/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/bug-series-angle-between-two-vectors.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7068559639853207505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7068559639853207505'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/bug-series-angle-between-two-vectors.html' title='Bug Series - angle between two vectors'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-2780010336742415097</id><published>2010-08-20T18:56:00.000+08:00</published><updated>2010-08-20T18:57:08.005+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bug series'/><category scheme='http://www.blogger.com/atom/ns#' term='link error'/><title type='text'>Bug Series_Programing_link error_unresolved external symbol</title><content type='html'>&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;span id="internal-source-marker_0.3891746038571" style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;之前&lt;/span&gt;&lt;img src="https://docs.google.com/drawings/image?id=sC2CKLt7OYDCbu7yotfHWIA&amp;amp;w=610&amp;amp;h=298&amp;amp;rev=103&amp;amp;ac=1" width="610px;" height="298px;" /&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;最上层的基础库都是static library(.lib), 中间的core要是static library(.lib), 然后被应用层的main.cpp直接生成application.exe. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;这么弄一直没有问题, 直到...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;直到我想加入一个ImageEditor的plugin, 作为一个dynamic library(.dll)存在, 这个plugin需要使用core提供的interface来调用application里面的类和member function, 而core在里面也需要能检查到这个加入的plugin并使用它。&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;compilation没有问题，但是在link时候就出错了: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;error LNK2019: unresolved external symbol "__declspec(dllimport) public ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;后来发现那个core作为static library是有问题，因为static library不能包含别的static library和dynamic library . 于是我把core作为dynamic library就ok了.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;但是这样又引入了新的问题, dynamic library需要导出一些接口，别的.dll/.exe才能使用, 否则例如main.cpp和ImageEditor中就不能使用了。&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;于是就引入了__declspec attributes.  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://blog.csdn.net/alicehyxx/archive/2010/01/08/5161868.aspx"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://blog.csdn.net/alicehyxx/archive/2010/01/08/5161868.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/zh-cn/library/9h658af8(v=VS.80).aspx"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://msdn.microsoft.com/zh-cn/library/9h658af8(v=VS.80).aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/zh-cn/library/z4zxe9k8(v=VS.80).aspx"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://msdn.microsoft.com/zh-cn/library/z4zxe9k8(v=VS.80).aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/zh-cn/library/fdy23fx6(v=VS.80).aspx"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://msdn.microsoft.com/zh-cn/library/fdy23fx6(v=VS.80).aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/zh-cn/library/a90k134d(v=VS.80).aspx"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://msdn.microsoft.com/zh-cn/library/a90k134d(v=VS.80).aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/zh-cn/library/900axts6(v=VS.80).aspx"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://msdn.microsoft.com/zh-cn/library/900axts6(v=VS.80).aspx&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-2780010336742415097?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/2780010336742415097/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/bug-seriesprograminglink.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2780010336742415097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2780010336742415097'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/bug-seriesprograminglink.html' title='Bug Series_Programing_link error_unresolved external symbol'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3647253249323978843</id><published>2010-08-20T18:12:00.001+08:00</published><updated>2010-08-20T18:13:24.760+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='math series'/><title type='text'>Math Series -  Cycloid 摆线 轮滚线</title><content type='html'>&lt;div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;span id="internal-source-marker_0.40710389986634254" style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;想象这么一个情景：车子来开，一个车轮压到地面的口香糖，口香糖粘到轮子上了（会这样子么？) 假如问轮子转一圈之后口香糖划过的距离长？:-)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;首先这个划过的曲线叫做轮滚线，一个很形象的名字，至于那个长度怎么求了嘛，以及这个曲线跟地面的面积怎么求，请看:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://tutorial.math.lamar.edu/Classes/CalcII/ParaArea.aspx"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;http://tutorial.math.lamar.edu/Classes/CalcII/ParaArea.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt; and the next section.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="https://docs.google.com/document/pub?id=1R4C7rCr7HguVIxUMVHHXl_f7ehMATFGUPBeOqpmTiQI"&gt;https://docs.google.com/document/pub?id=1R4C7rCr7HguVIxUMVHHXl_f7ehMATFGUPBeOqpmTiQI&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3647253249323978843?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3647253249323978843/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/math-series-cycloid.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3647253249323978843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3647253249323978843'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/math-series-cycloid.html' title='Math Series -  Cycloid 摆线 轮滚线'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-6574672598721876087</id><published>2010-08-03T17:22:00.003+08:00</published><updated>2010-08-03T17:29:39.100+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='external'/><category scheme='http://www.blogger.com/atom/ns#' term='geometry'/><title type='text'>interesting stuff about geometry</title><content type='html'>1. a mesh composes of vertex attributes(geometry information) and adjacency(topology information). How about compress they independently? &lt;a href="http://openctm.sourceforge.net/"&gt;http://openctm.sourceforge.net/&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Some special mesh can be generated automatically, does not need to add faces/vertices manually. check &lt;a href="http://prideout.net/blog/?p=44"&gt;http://prideout.net/blog/?p=44&lt;/a&gt; and &lt;a href="http://structuresynth.sourceforge.net/"&gt;http://structuresynth.sourceforge.net/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. I'm always interested in the geometry engine of CAD or something like that. &lt;a href="http://wildcat-cad.blogspot.com/"&gt;http://wildcat-cad.blogspot.com/&lt;/a&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-6574672598721876087?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/6574672598721876087/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/interesting-stuff-about-geometry.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/6574672598721876087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/6574672598721876087'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/08/interesting-stuff-about-geometry.html' title='interesting stuff about geometry'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1819506612416269416</id><published>2010-06-20T15:44:00.004+08:00</published><updated>2010-06-20T15:47:53.614+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenGL'/><title type='text'>To render the vertex</title><content type='html'>目的是用OpenGL 3.2来画东西, 而不是glVertex, glColor.&lt;br /&gt;&lt;img src="http://docs.google.com/drawings/image?w=400&amp;amp;h=400&amp;amp;ac=1&amp;amp;id=sUcIHow8U6cDJ-BNUNQ_OSQ&amp;amp;rev=35" /&gt;           &lt;br /&gt;&lt;br /&gt;Step 1:&lt;div&gt;准备Vertex Data:&lt;/div&gt;&lt;div&gt;(1). vertex count 有多少个数据? (2). 具体的vertex data, （3）这些数据的大小(in byte)&lt;/div&gt;&lt;div&gt;例如:&lt;/div&gt;&lt;div&gt;const GLint coordinateLineVertexCount = 6;&lt;/div&gt;&lt;div&gt;const GLint coordinateLineVertexSize = sizeof(dgp::vec3f) * 2 * coordinateLineVertexCount; &lt;/div&gt;&lt;div&gt;dgp::vec3f coordinateLineVertexData[] =  { &lt;/div&gt;&lt;div&gt;    // vertex position              // vertex color &lt;/div&gt;&lt;div&gt;    dgp::vec3f(0, 0, 0),             dgp::vec3f(1, 0, 0), &lt;/div&gt;&lt;div&gt;    dgp::vec3f(fLength, 0, 0),    dgp::vec3f(1, 0, 0), &lt;/div&gt;&lt;br /&gt;&lt;div&gt;    dgp::vec3f(0, 0, 0),             dgp::vec3f(0, 1, 0),    &lt;/div&gt;&lt;div&gt;    dgp::vec3f(0, fLength, 0),    dgp::vec3f(0, 1, 0), &lt;/div&gt;&lt;br /&gt;&lt;div&gt;    dgp::vec3f(0, 0, 0),             dgp::vec3f(0, 0, 1),&lt;/div&gt;&lt;div&gt;    dgp::vec3f(0, 0, fLength),     dgp::vec3f(0, 0, 1)   &lt;/div&gt;&lt;div&gt;};&lt;/div&gt;注意每一个vertex data包含了两部分, position and color.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Step 2:&lt;/div&gt;&lt;div&gt;生成一个buffer object放这些vertex data.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Step 3:&lt;/div&gt;&lt;div&gt;生成一个shader program，&lt;br /&gt;  &lt;img src="http://docs.google.com/drawings/image?w=267&amp;amp;h=267&amp;amp;ac=1&amp;amp;id=sk6_2N2CuUxg1A_UGtydxaw&amp;amp;rev=20" /&gt;                  &lt;br /&gt;&lt;br /&gt;Step 4:&lt;/div&gt;当真正需要render的时候, 往shader program的相应的location里面写入对应的数据.&lt;div&gt;例如: projection matrix, model view matrix, the vertex data (position, normal, color) ....&lt;/div&gt;&lt;div&gt;然后指定画成什么primitive形式。&lt;/div&gt;&lt;br /&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_382dngb8nfp_b" style="float:left;height:413px;margin-left:0px;margin-right:1em;width:420px" /&gt;使用glVertex的特点是容易入手, 现在需要自己手工来完成上面好几个steps才可以。但是特点是思路很清晰，先打包好vertex data，往shader program里面放这些数据，条理清晰。&lt;br /&gt;&lt;br /&gt;&lt;div&gt;相对于glColor来给出顶点的颜色, 在shader里面的做法 我用了下面三种最简单的(每一种对应一个shader program)：&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;例如图中的Grid，all the vertices are the same color, they are same color in fragment too, 所以我在fragment shader中用了一个uniform vec3 fragmentColor;程序中指定这个颜色，黑色，就ok了。&lt;/div&gt;&lt;br /&gt;&lt;div&gt;例如图中的coordinate system line，一个红线，一个绿色的线，一个蓝色的线。就需要每一个vertex 给出 color 信息. vertex shader 中:&lt;/div&gt;&lt;div&gt;in vec3 position;&lt;/div&gt;&lt;div&gt;in vec3 color; // 之后取他们的location并写入准备好的data.&lt;/div&gt;&lt;br /&gt;例如图中的Cube, 用Blinn Phong lighting，fragment shader中计算color.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1819506612416269416?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1819506612416269416/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/to-render-vertex_20.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1819506612416269416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1819506612416269416'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/to-render-vertex_20.html' title='To render the vertex'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-5768580824240567645</id><published>2010-06-18T23:50:00.002+08:00</published><updated>2010-06-20T15:49:32.771+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='design pattern'/><title type='text'>Thinking about Singleton</title><content type='html'>&lt;div&gt;1. The constructor should not have parameters? &lt;/div&gt;&lt;div&gt;In the GoF Design Patterns, there is no parameter for the constructor. That makes it very easy, because the constructor is invoked by the instance() method, if the constructor needs parameters, do we send the parameters to the instance() method, which pass them to the constructor? It is not clean and clear.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;class Singleton {&lt;/div&gt;&lt;div&gt;public:&lt;/div&gt;&lt;div&gt;    static Singleton *instance();&lt;br /&gt;&lt;/div&gt;&lt;div&gt;protected:&lt;/div&gt;&lt;div&gt;    Singleton();&lt;br /&gt;&lt;/div&gt;&lt;div&gt;private:&lt;/div&gt;&lt;div&gt;    static Singleton *s_pInstance;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;};&lt;/div&gt;&lt;br /&gt;But if the the constructor do need some parameters, how to do that?&lt;br /&gt;&lt;br /&gt;&lt;div&gt;2. The constructor need to be protected/privated? &lt;/div&gt;In the GoF Design Patterns, the constructor is protected, which make sure that the clients (from outside) can not instantiate objects directly. &lt;div&gt;But if we want to create a new Singleton instance?&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;class Singleton {&lt;/div&gt;&lt;div&gt;public:&lt;/div&gt;&lt;div&gt;    static Singleton* createNewInstance();&lt;/div&gt;&lt;div&gt;    static Singleton* instance();    &lt;/div&gt;&lt;div&gt;protected:&lt;/div&gt;&lt;div&gt;    Singleton();&lt;br /&gt;&lt;/div&gt;&lt;div&gt;private:&lt;/div&gt;&lt;div&gt;    static Singleton *s_pInstance;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;};&lt;/div&gt;&lt;br /&gt;The following is an example. For example, a new scene is created whenever a scene file is loaded/read.&lt;br /&gt;Scene* Scene::s_pThis= 0;&lt;br /&gt;&lt;div&gt;Scene* Scene::instance() {&lt;/div&gt;&lt;div&gt;    if (s_pThis) {&lt;/div&gt;&lt;div&gt;        return s_pThis;&lt;/div&gt;&lt;div&gt;    } else {&lt;/div&gt;&lt;div&gt;        return createNewScene();&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;Scene* createNewScene() { &lt;/div&gt;&lt;div&gt;    if (s_pInstance ) {&lt;/div&gt;&lt;div&gt;        // delete, this will call the deconstructor.&lt;/div&gt;&lt;div&gt;        delete s_pThis; &lt;/div&gt;&lt;div&gt;        s_pThis= 0;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    s_pThis= new Scene;&lt;/div&gt;&lt;div&gt;    return s_pThis;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br /&gt;In this case, the instance() returns the object instance which is active, others are discarded.&lt;div&gt;And in this case, we can change it a little bit:&lt;/div&gt;&lt;div&gt;(1) firstly, call this method to create instance.&lt;/div&gt;static Singleton* createNewInstance(...parameters...);&lt;br /&gt;(2) call the instance() use the instance object.&lt;div&gt;This makes a assumption that, create it before you use it.&lt;/div&gt;&lt;br /&gt;3. The copy constructor and assignment operator ?&lt;div&gt;See this example:&lt;/div&gt;&lt;div&gt;Scene s = *Scene::instance(); // this will call the copy constructor.&lt;/div&gt;Scene s; // this will call the default constructor.&lt;div&gt;void functionX(Scene s) {&lt;/div&gt;&lt;div&gt;    s is a temp instance object...&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;functionX(*Scene::instance()); // this will call the copy constructor;&lt;br /&gt;Maybe, it would be safer to private these two methods.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;4. How about the s_pInstance in derived class?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-5768580824240567645?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/5768580824240567645/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/thinking-about-singleton.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5768580824240567645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5768580824240567645'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/thinking-about-singleton.html' title='Thinking about Singleton'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-2491639663120036629</id><published>2010-06-16T14:29:00.002+08:00</published><updated>2010-06-20T15:48:44.734+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='intersection'/><category scheme='http://www.blogger.com/atom/ns#' term='math series'/><title type='text'>Math Series - Quadratic equation</title><content type='html'>&lt;img alt="Ax^{2} + Bx+C=0" class="ee_img tr_noresize" eeimg="1" src="https://www.google.com/chart?cht=tx&amp;amp;chf=bg,s,FFFFFF00&amp;amp;chco=000000&amp;amp;chl=Ax%5E%7B2%7D%20%2B%20Bx%2BC%3D0" style="vertical-align:middle" /&gt;&lt;br /&gt;&lt;div&gt;the solutions are:&lt;/div&gt;&lt;div&gt;&lt;img alt="\frac{B\pm \sqrt{B^{2} -4AC} }{2} " class="ee_img tr_noresize" eeimg="1" src="https://www.google.com/chart?cht=tx&amp;amp;chf=bg,s,FFFFFF00&amp;amp;chco=000000&amp;amp;chl=%5Cfrac%7BB%5Cpm%20%5Csqrt%7BB%5E%7B2%7D%20-4AC%7D%20%7D%7B2%7D%20" style="vertical-align:middle" /&gt;&lt;br /&gt;&lt;/div&gt;初中的二次方程啊:-) 我们都知道怎么解，但是有没有想过怎么建立这个方程式呢？It is meaningless until we know how to build it.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Case 1. Points on a sphere, and Ray - Sphere intersection.&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter1.htm"&gt;http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter1.htm&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-2491639663120036629?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/2491639663120036629/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/math-series-quadratic-equation.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2491639663120036629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2491639663120036629'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/math-series-quadratic-equation.html' title='Math Series - Quadratic equation'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-8903508461466916952</id><published>2010-06-11T22:07:00.002+08:00</published><updated>2010-06-20T15:50:01.346+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><title type='text'>Bug Series - 无效的int变成了有效的unsigned char</title><content type='html'>Today, i came across this kind of bug:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;int iIndex = -1 ;// -1 means invaluable value. &amp;gt;=0 means valuable.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;unsigned char ucIdx = iIndex;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;if (ucIdx &amp;gt;= 0) { // this is error-prone, most of time ucIdx &amp;gt;= 0 is true.&lt;/div&gt;&lt;div&gt;  do sth here;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br /&gt;When iIndex = -1, the ucIdx is 255, so even you think iIndex is invaluable, but the ucIdx &amp;gt;= 0 is ture, so error happens.&lt;div&gt;Why?&lt;div&gt;Take a two bits value as an example. 2 bits can express 4 values,&lt;/div&gt;&lt;div&gt;unsigned: 00, 01, 10, 11&lt;/div&gt;&lt;div&gt;               0,  1,   2,  3.&lt;/div&gt;&lt;div&gt;   signed: 11, 00, 01, 10&lt;/div&gt;&lt;div&gt;              -1,  0,   1,  2.&lt;/div&gt;&lt;div&gt;It is clear that the signed value -1 means 3 at unsigned value.&lt;/div&gt;&lt;div&gt;so, the ucIdx = iIndex = -1 means 255, which obviously/obviously &amp;gt;= 0. The bug comes from here.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-8903508461466916952?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/8903508461466916952/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/bug-series-intunsigned-char.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8903508461466916952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8903508461466916952'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/bug-series-intunsigned-char.html' title='Bug Series - 无效的int变成了有效的unsigned char'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-7494047231915625008</id><published>2010-06-11T21:36:00.002+08:00</published><updated>2010-06-20T15:50:17.032+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><title type='text'>Bug Series - 数组变小了</title><content type='html'>Let see look the a tree structure first:&lt;br /&gt;&lt;div id="pjvj" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_371dk357sdq_b" style="height:231.598531px;width:648px" /&gt;&lt;/div&gt;一个Scene底下有两个geometry, 后来在Scene下还多建立了一个Skeleton来做skinning, 这个skinning与那两个geometry有关，是作用于它们上面的, 具体的skinning操作变换在各自的SkeletonReference中。&lt;br /&gt;&lt;div&gt;并且为了记录这个Skeleton 是操作哪些Geometry的，于是Skeleton有一个成员m_arrGeo[]是一个数组, 这个例子中记录的是两个指针.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;下面的问题是: 我要删除这个skinning操作, 也就是将Skeleton和两个SkeletonReference删除掉.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;code:&lt;/div&gt;&lt;div&gt;for (int i = 0; i &amp;lt; skeleton-&amp;gt;m_arrGeo.size(); ++i) {&lt;/div&gt;&lt;div&gt;    delete skeleton-&amp;gt;m_arrGeo[i]-&amp;gt;skeleton_reference;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;delete skeleton;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;这个代码段在Skeleton只作用于一个Geometry时候运行正常, 但是当作用于两个和多个Geometry时候就错误了(错误是隐晦地遗留到后面别的地方才造成的，不是在这里就造成，这才是恐怖的地方). &lt;/div&gt;&lt;br /&gt;&lt;div&gt;for (int i = 0; i &amp;lt; skeleton-&amp;gt;m_arrGeo.size(); ++i) {&lt;/div&gt;&lt;div&gt;    &lt;span style="color:#990000;"&gt;print out the size = 2;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    &lt;span style="color:#0000FF;"&gt;delete skeleton-&amp;gt;m_arrGeo[i]-&amp;gt;skeleton_reference;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color:#990000;"&gt;    print out the size = 1;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;delete skeleton;&lt;/div&gt;&lt;br /&gt;可见问题在于 after executing the blue line, one element has been removed from the array. so let take a look at the de-constructor of SkeletonReference.&lt;br /&gt;&lt;div&gt;~SkeletonReference() {&lt;/div&gt;&lt;div&gt;    find if the parent (the Geometry_i) is in the m_arrGeo[],&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    if yes, remove it.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;Actually, this method makes sense, because when a geometry do not possess a SkeleteReference, there is no need to be recorded in the m_arrGeo[] array.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;So, the problem is in the for sentence. &lt;/div&gt;for (&lt;span style="color:#CC0000;"&gt;&lt;i&gt;int i = 0; i &amp;lt; skeleton-&amp;gt;m_arrGeo.size(); ++i&lt;/i&gt;&lt;/span&gt;) { &lt;div&gt;    // we are iterating a dynamic array. &lt;/div&gt;&lt;div&gt;    // we can not make sure that we can visit all the elements.&lt;br /&gt;&lt;div&gt;    ...&lt;br /&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;change it to:&lt;/div&gt;&lt;div&gt;std::vector&amp;lt;Geometry *&amp;gt; arrGeo = &lt;span style="color:#cc0000;"&gt;&lt;i&gt;skeleton-&amp;gt;m_arrGeo;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;for (&lt;span style="color:#CC0000;"&gt;&lt;i&gt;int i = 0; i &amp;lt; arrGeo.size(); ++i&lt;/i&gt;&lt;/span&gt;) { &lt;div&gt;    // this is right.&lt;/div&gt;&lt;div&gt;     &lt;span style="color:#0000FF;"&gt;delete arrGeo[i]-&amp;gt;skeleton_reference;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-7494047231915625008?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/7494047231915625008/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/bug-series.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7494047231915625008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7494047231915625008'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/bug-series.html' title='Bug Series - 数组变小了'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3460143660428023153</id><published>2010-06-07T23:43:00.002+08:00</published><updated>2010-06-20T15:50:39.483+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='design pattern'/><title type='text'>ComboBox - model/view</title><content type='html'>&lt;div id="ckn7" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_369hh33j8c9_b" style="height:225.094737px;width:648px" /&gt;&lt;/div&gt;array E[]中有一些元素，希望放到一个ComboBox中可以让用户来选择用哪一个.&lt;br /&gt;&lt;div&gt;但是有时候E中有些元素有不想显示在ComboBox中. &lt;/div&gt;&lt;div&gt;这里的解决方法是将某一部分ei作为itemI, 当用户选择了某一个item时候返回其string,再到E中找对应的idx.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3460143660428023153?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3460143660428023153/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/combobox-modelview.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3460143660428023153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3460143660428023153'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/06/combobox-modelview.html' title='ComboBox - model/view'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-757735677656455641</id><published>2010-05-30T23:23:00.002+08:00</published><updated>2010-06-20T15:51:11.896+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><title type='text'>Bug Series - crash at delete pointer</title><content type='html'>&lt;div&gt;void Scene::setCamera(Camera *_camera) {&lt;/div&gt;&lt;div&gt;    if (m_pCamera) { &lt;/div&gt;&lt;div&gt;        delete m_pCamera; &lt;/div&gt;&lt;div&gt;        m_pCamera = 0;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    this-&amp;gt;m_pCamera = _camera;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;这个是错的, 因为第一次到if时候, m_pCamera之前不一定是new出来的而因为垃圾数据而非零, 于是在delete时候就crash了.&lt;/div&gt;&lt;div&gt;所以m_pCamera需要在构造函数中初始化为0.&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-757735677656455641?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/757735677656455641/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/05/crash-at-delete-pointer.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/757735677656455641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/757735677656455641'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/05/crash-at-delete-pointer.html' title='Bug Series - crash at delete pointer'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-7885649213920167008</id><published>2010-05-16T10:39:00.002+08:00</published><updated>2010-05-16T10:45:18.075+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='gaussian'/><category scheme='http://www.blogger.com/atom/ns#' term='blur'/><title type='text'>Gaussian Blur</title><content type='html'>&amp;#38656;&amp;#27714;: &amp;#22312;&amp;#30475;OpenCL&amp;#30340;Gaussian Blur&amp;#20363;&amp;#23376;.&lt;br&gt;&amp;#22522;&amp;#26412;&amp;#27010;&amp;#24565;&amp;#30475;&lt;a href="http://en.wikipedia.org/wiki/Gaussian_blur"&gt;http://en.wikipedia.org/wiki/Gaussian_blur&lt;/a&gt;&amp;#65292;&amp;#26377;&amp;#19968;&amp;#20010;&amp;#26032;&amp;#30340;&amp;#27010;&amp;#24565;&amp;#26159;&lt;b&gt;linearly separable&lt;/b&gt;, &amp;#21407;&amp;#26412;&amp;#26159;&amp;#19968;&amp;#20010;&amp;#26377;&amp;#26435;&amp;#20540;&amp;#32452;&amp;#25104;&amp;#30340;&amp;#26041;&amp;#24418;&amp;#30697;&amp;#38453;&amp;#26469;&amp;#23545;&amp;#21608;&amp;#22260;&amp;#30340;pixel&amp;#20570;&amp;#21152;&amp;#26435;&amp;#21644;&amp;#65292;&amp;#29616;&amp;#22312;&amp;#20998;&amp;#24320;horizaontal and vertical direction&amp;#26041;&amp;#21521;&amp;#21508;&amp;#19968;&amp;#20010;pass&amp;#26469;&amp;#20808;&amp;#21518;&amp;#20570;&amp;#65292;&amp;#22909;&amp;#22788;&amp;#26159;&amp;#20160;&amp;#20040;&amp;#65311;&amp;#25552;&amp;#39640;performance, &amp;#23545;&amp;#27599;&amp;#19968;&amp;#20010;pixel&amp;#30340;&amp;#27714;&amp;#20540;&amp;#20174;width * height&amp;#20010;&amp;#20056;&amp;#27861;&amp;#38477;&amp;#20302;&amp;#21040;width + height&amp;#20010;&amp;#12290;&lt;div&gt;&amp;#20363;&amp;#22914;&amp;#23545;&amp;#20110;blur&amp;#23485;&amp;#24230;&amp;#26159;5&amp;#30340;&amp;#24773;&amp;#20917;, &amp;#26377;&amp;#20197;&amp;#19979;&amp;#20004;&amp;#20010;&amp;#39044;&amp;#24819;&amp;#27714;&amp;#24471;&amp;#30340;table&amp;#20540; &amp;#65288;&amp;#21462;&amp;#19981;&amp;#21516;&amp;#30340;&amp;#23485;&amp;#24230;&amp;#20540;&amp;#23601;&amp;#23545;&amp;#24212;&amp;#19981;&amp;#21516;&amp;#30340;&amp;#20004;&amp;#20010;tables. &amp;#33267;&amp;#20110;&amp;#36825;&amp;#20123;table&amp;#20540;&amp;#26159;&amp;#24590;&amp;#20040;&amp;#27714;&amp;#20986;&amp;#26469;&amp;#30340;&amp;#65292;standard deviation&amp;#21435;&amp;#20160;&amp;#20040;&amp;#20540;, &amp;#26159;&amp;#19981;&amp;#26159;&amp;#30452;&amp;#25509;&amp;#20195;&amp;#20837;&amp;#22352;&amp;#26631;&amp;#31639;&amp;#20986;&amp;#26469;&amp;#30340;&amp;#21602;?&amp;#26377;&amp;#24453;&amp;#32771;&amp;#35777;&amp;#65289;&amp;#65306;&lt;/div&gt;&lt;div&gt;&lt;div&gt;static float const blurOffsets5[] = { -4.37988, -2.43235, -0.486391, 1.45925, 3.40585, 5 };&lt;/div&gt;&lt;div&gt;static float const blurWeights5[] = {0.0953448, 0.200199, 0.275104, 0.24745, 0.145682, 0.0362198 };&lt;/div&gt;&lt;br&gt;&amp;#37027;&amp;#20040;&amp;#27700;&amp;#24179;(or &amp;#31446;&amp;#30452;)&amp;#19968;&amp;#20010;&amp;#26041;&amp;#21521;&amp;#30340;blur&amp;#32467;&amp;#26524;&amp;#23601;&amp;#26159;:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for (index = 0; index &amp;lt; 5; ++index) {&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pixel += read_imagef(srcImage, &amp;#24403;&amp;#21069;&amp;#22352;&amp;#26631; + (float2)(blurOffsets5[index], 0.0f)) * blurWeights5[index];&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;div id="c:4p" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_342hdwvh6cg_b" style="height:231.043062px;width:480px"&gt;&amp;nbsp;&amp;#24038;&amp;#36793;&amp;#26159;&amp;#21407;&amp;#22270;&amp;#65292;&amp;#21491;&amp;#36793;&amp;#25105;&amp;#20570;&amp;#20986;&amp;#26469;&amp;#21518;&amp;#20498;&amp;#26159;&amp;#20687;&amp;#26576;&amp;#31181;&amp;#28023;&amp;#24213;&amp;#30340;&amp;#28014;&amp;#28216;&amp;#21160;&amp;#29289;&amp;#12290;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div&gt;&amp;#21478;&amp;#19968;&amp;#20010;&amp;#35805;&amp;#39064; Guassian distribution,(normal distribution).&lt;/div&gt;&amp;#19968;&amp;#32500;&amp;#24773;&amp;#20917;&amp;#19979;&amp;#65292;&amp;#36825;&amp;#20010;&amp;#39640;&amp;#26031;&amp;#20998;&amp;#24067;(&amp;#27491;&amp;#24577;&amp;#20998;&amp;#24067;)&amp;#30340;curve&amp;#30340;&amp;#20989;&amp;#25968;&amp;#26159;&amp;nbsp;&lt;img alt="P(x)=\frac{1}{\sqrt{2\pi } \sigma  } e^{-(x-\mu )^{2} /2\sigma ^{2} } " class="ee_img tr_noresize" eeimg="1" src="https://www.google.com/chart?cht=tx&amp;amp;chf=bg,s,FFFFFF00&amp;amp;chco=000000&amp;amp;chl=P(x)%3D%5Cfrac%7B1%7D%7B%5Csqrt%7B2%5Cpi%20%7D%20%5Csigma%20%20%7D%20e%5E%7B-(x-%5Cmu%20)%5E%7B2%7D%20%2F2%5Csigma%20%5E%7B2%7D%20%7D%20" style="vertical-align:middle"&gt;.&amp;#36825;&amp;#20010;curve&amp;#30340;&amp;#29305;&amp;#28857;&amp;#21253;&amp;#25324;the total area under it is equal to one. &amp;#20026;&amp;#20160;&amp;#20040;&amp;#38656;&amp;#35201;&amp;#36825;&amp;#20010;requirement&amp;#21602;? &amp;#24456;&amp;#21487;&amp;#33021;&amp;#26159;&amp;#22240;&amp;#20026;Guassian&amp;#20989;&amp;#25968;&amp;#20316;&amp;#20026;probability distribution functions&amp;#30340;&amp;#19968;&amp;#31181;&amp;#65292;&amp;#32780;&amp;#21518;&amp;#32773;&amp;#26377;&amp;#36825;&amp;#20010;&amp;#35201;&amp;#27714;&amp;#65292;&amp;#37027;Gaussian&amp;#20989;&amp;#25968;&amp;#33258;&amp;#28982;&amp;#20063;&amp;#38656;&amp;#35201;&amp;#28385;&amp;#36275;. &amp;#37027;&amp;#20010;mean&amp;nbsp;&lt;img alt="\mu " class="ee_img tr_noresize" eeimg="1" src="https://www.google.com/chart?cht=tx&amp;amp;chf=bg,s,FFFFFF00&amp;amp;chco=000000&amp;amp;chl=%5Cmu%20" style="vertical-align:middle"&gt;&amp;#25511;&amp;#21046;&amp;#26159;curve&amp;#30340;&amp;#20013;&amp;#24515;&amp;#20540;, &amp;#32780;standard deviation&amp;#25511;&amp;#21046;&amp;#30340;&amp;#26159;&amp;#26354;&amp;#32447;&amp;#24418;&amp;#29366;&amp;#30340;&amp;#23485;&amp;#24230;.&lt;br&gt;&lt;br&gt;&amp;#37027;&amp;#20040;&amp;#20026;&amp;#20160;&amp;#20040;&amp;#39640;&amp;#26031;&amp;#20998;&amp;#24067;&amp;#22312;&amp;#33258;&amp;#28982;&amp;#20013;&amp;#36825;&amp;#20040;&amp;#24120;&amp;#35265;&amp;#21602;&amp;#65311;&amp;#29978;&amp;#33267;&amp;#35828;&amp;#19968;&amp;#20010;&amp;#23398;&amp;#26657;&amp;#37324;&amp;#38754;&amp;#23398;&amp;#29983;&amp;#30340;&amp;#32771;&amp;#35797;&amp;#25104;&amp;#32489;&amp;#20063;&amp;#26159;&amp;#25104;&amp;#39640;&amp;#26031;&amp;#20998;&amp;#24067;&amp;#12290;&lt;b&gt;Central Limit Theorem&lt;/b&gt; &amp;#26159;&amp;#19968;&amp;#31181;&amp;#35299;&amp;#37322;. &amp;quot;In its simplest form, the Central Limit Theorem states that a sum of random numbers becomes normally distributed as more and more of the random numbers are added together. It does not require the individual random numbers be from any particular distribution, or even that the random numbers be from the same distribution&amp;quot;[The Scientist and Engineer&amp;#39;s Guide to Digital Signal Processing, Steven W. Smith].&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-7885649213920167008?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/7885649213920167008/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/05/gaussian-blur.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7885649213920167008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7885649213920167008'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/05/gaussian-blur.html' title='Gaussian Blur'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-7999201322024217638</id><published>2010-05-15T14:22:00.002+08:00</published><updated>2010-05-15T14:24:48.249+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='work item'/><category scheme='http://www.blogger.com/atom/ns#' term='opencl'/><title type='text'>How to locate the work item in OpenCL?</title><content type='html'>&lt;div&gt;How to locate the work item in OpenCL?  &lt;/div&gt;&lt;div&gt;- Reading Notes of OpenCL Specification version 1.0.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Global ID: A global ID is used to uniquely identify a work-item and is derived from the number&lt;/div&gt;&lt;div&gt;of global work-items specified when executing a kernel. The global ID is a N-dimensional value&lt;/div&gt;&lt;div&gt;that starts at (0, 0,  0). See also Local ID.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Local ID: A local ID specifies a unique work-item ID within a given work-group that is&lt;/div&gt;&lt;div&gt;executing a kernel. The local ID is a N-dimensional value that starts at (0, 0,  0). See also&lt;/div&gt;&lt;div&gt;Global ID.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Work-item: One of a collection of parallel executions of a kernel invoked on a device by a&lt;/div&gt;&lt;div&gt;command. A work-item is executed by one or more processing elements as part of a work-group&lt;/div&gt;&lt;div&gt;executing on a compute unit. A work-item is distinguished from other executions within the&lt;/div&gt;&lt;div&gt;collection by its global ID and local ID.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;a single work-item can be uniquely identified by its global ID or by a combination of its local ID and work-group ID.&lt;/div&gt;&lt;div&gt;Each work-item is identifiable in two ways; in terms of a global index, and in terms of a work-group index plus a&lt;/div&gt;&lt;div&gt;local index within a work group.\&lt;/div&gt;&lt;br /&gt;下图显示这些id的计算:&lt;br /&gt;&lt;div style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_338hkk4f4dd_b" style="height:446.960168px;width:800px" /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;uint get_work_dim(); Returns the number of dimensions in use.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;size_t get_global_size(uint dimindx);&lt;/div&gt;图中是 Gx * Sx = get_global_size(0);  Gy * Sy = get_global_size(1); 一行or一列的总的items数目.&lt;div&gt;&lt;br /&gt;size_t get_gloabl_id (uint dimindx);&lt;div&gt;例如上图中gx = get_global_id(0); gy = get_global_id(1); 一行or一列中的第几个.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;size_t get_local_size(uint dimindx);&lt;/div&gt;&lt;div&gt;图中的 Sx and Sy. 表示一个work group中一行的items数目or 一列的items数目. &lt;/div&gt;&lt;br /&gt;size_t get_local_id (uint dimindx);&lt;div&gt;例如上图中sx = get_local_id(0); sx = get_local_id(1); 表示某一个work group中一行or一列中的第几个.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;size_t get_num_groups(uint dimindx);&lt;/div&gt;&lt;div&gt;图中的 Gx or Gy. 表示每行or每列有多少个work group. &lt;/div&gt;&lt;br /&gt;size_t get_group_id(uint dimindx);&lt;/div&gt;&lt;div&gt;图中的wx or wy. 表示一行or一列中的第几个work group. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;这些build-in function是足够计算几种id的转化了.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;i&gt;global_work_size&lt;/i&gt;: points to an array of &lt;i&gt;work_dim&lt;/i&gt; unsigned values that describe the number of&lt;/div&gt;&lt;div&gt;global work-items in work_dim dimensions that will execute the kernel function. The total&lt;/div&gt;&lt;div&gt;number of global work-items is computed as &lt;i&gt;global_work_size[0]&lt;/i&gt; * ... * &lt;i&gt;global_work_size[work_dim - 1]&lt;/i&gt;.&lt;/div&gt;我理解在上图, work_dim 就是2指二维, global_work_size[0] = Gx, global_work_size[1] = Gy.&lt;br /&gt;这两个值可以通过函数取得: size_t get_global_size(uint dimindx); valid values of dimindx are 0 to get_work_dim() - 1;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;i&gt;local_work_size&lt;/i&gt; points to an array of &lt;i&gt;work_dim&lt;/i&gt; unsigned values that describe the number of&lt;/div&gt;&lt;div&gt;work-items that make up a work-group (also referred to as the size of the work-group) that will &lt;/div&gt;&lt;div&gt;execute the kernel specified by kernel. The total number of work-items in a work-group is&lt;/div&gt;&lt;div&gt;computed as &lt;i&gt;local_work_size[0] * ... * local_work_size[work_dim - 1]&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;我理解在上图, work_dim 就是2指二维, local_work_size[0] = Sx, local_work_size[1] = Sy.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;这两个值可以通过函数取得: size_t get_local_size(uint dimindx); valid values of dimindx are 0 to get_work_dim() - 1;&lt;/div&gt;&lt;br /&gt;local_work_size can also be a NULL value in which case the OpenCL implementation will&lt;br /&gt;&lt;div&gt;determine how to be break the global work-items into appropriate work-group instances.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If local_work_size is specified, the values specified in global_work_size[0], … global_work_size[work_dim - 1] &lt;/div&gt;&lt;div&gt;must be evenly divisible by the corresponding values specified in local_work_size[0], … local_work_size[work_dim – 1].&lt;/div&gt;&lt;div&gt;这个就很容易出错了, 例如一个image是300 * 300, 我就不能设置local size为 8 * 8. &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-7999201322024217638?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/7999201322024217638/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/05/how-to-locate-work-item-in-opencl.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7999201322024217638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7999201322024217638'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/05/how-to-locate-work-item-in-opencl.html' title='How to locate the work item in OpenCL?'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-8355314833119675697</id><published>2010-05-08T13:11:00.004+08:00</published><updated>2010-05-08T13:27:29.520+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='blending'/><category scheme='http://www.blogger.com/atom/ns#' term='tech'/><category scheme='http://www.blogger.com/atom/ns#' term='alpha'/><category scheme='http://www.blogger.com/atom/ns#' term='blend mode'/><title type='text'>premultiplied alpha</title><content type='html'>什么是Compositing (Alpha Composition) ?&lt;br /&gt;&lt;img alt="simplealpha.png" src="http://www.svgopen.org/2005/papers/abstractsvgopen/simplealpha.png" style="float:left;height:228.217054px;margin-left:0px;margin-right:1em;width:320px" /&gt;&lt;div&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:times, serif;"&gt;&lt;span style="color:#ff0000;"&gt;"Compositing is the process by which graphical objects are combined. Alpha compositing uses the alpha values, or channel (bit mask) to represent the coverage of each pixel. The alpha channel is often said to represent the 'opacity'. This coverage information is used to control the compositing of colors. " [2]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:sans-serif;"&gt;"In &lt;a href="http://en.wikipedia.org/wiki/Computer_graphics" style="background-color:initial;background-image:none;color:#002bb8;text-decoration:none" title="Computer graphics"&gt;computer graphics&lt;/a&gt;, &lt;b&gt;alpha compositing&lt;/b&gt; is the process of combining an image with a background to create the appearance of partial transparency. It is often useful to render image elements in separate passes, and then combine the resulting multiple 2D images into a single, final image in a process called compositing."[1]&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;平时我看到的alpha blending好像就是所谓的&lt;b&gt;&lt;i&gt;simple alpha compositing&lt;/i&gt;&lt;/b&gt;, 好像就是Porter-Duff paper中的&lt;b&gt;&lt;i&gt;over operation&lt;/i&gt;&lt;/b&gt;.[2]: &lt;a href="http://www.svgopen.org/2005/papers/abstractsvgopen/simplealpha.png" id="tvq_" title="http://www.svgopen.org/2005/papers/abstractsvgopen/simplealpha.png"&gt;http://www.svgopen.org/2005/papers/abstractsvgopen/simplealpha.png&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;涉及在对两个bitmaps做blending的时候: 左边的表述是已有的底片，右边的表述是要画在上面的, &lt;/div&gt;&lt;br /&gt;&lt;div&gt;backdrop                     layer/source&lt;/div&gt;&lt;div&gt;based image                 blend image&lt;/div&gt;&lt;div&gt;target                         source image&lt;/div&gt;&lt;div&gt;framebuffer                  texel &lt;/div&gt;background                  foreground&lt;br /&gt;&lt;br /&gt;&lt;div&gt;-----------------foreground      * alpha&lt;/div&gt;&lt;div&gt;-----------------background     *(1-alpha)   =&amp;gt;  result.&lt;br /&gt;&lt;br /&gt;想象一种situation，已经在framebuffer上画好了model，上面加一个painting layer，需要将这个painting layer放到上面去。&lt;br /&gt;&lt;div id="rg5e" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_318g72wbddm_b" style="height:282.929577px;width:648px" /&gt; fig "". &lt;/div&gt;这个图片用到公式就是很常用的，我觉得就是上面讲到的simple alpha compositing. 而且这公式的color compenent是un-premultiplied的，所以公式中加号+后面blend * blend.a.&lt;/div&gt;&lt;div&gt;如果是用了pre-multiplied color compenent的话， result = based * (1 - blend.a) + blend. 这就是Porter-Duffer paper中的"over" operator. 这就说明了我们平时常见的blending和Porter-Duffer compositing的关系了，并不contrary矛盾的。&lt;/div&gt;&lt;br /&gt;Classic paper: Compositing Digital Image, 1984. &lt;a href="http://keithp.com/~keithp/porterduff/"&gt;http://keithp.com/~keithp/porterduff/&lt;/a&gt;&lt;br /&gt;第2节The Alpha Channel 解释了为什么需要因为&lt;b&gt;&lt;i&gt;alpha channel&lt;/i&gt;&lt;/b&gt;，因为需要"retain the matte information. the extent of the coverage of an element at a pixel. An alpha of 0 indicate no coverage, 1 means full coverage, fractions corresponding to partial coverage."&lt;br /&gt;&lt;br /&gt;里面有一个问题: "how do we express that a pixel is half covered by a full red object? &lt;div&gt;One obvious suggestion is to assign (1, 0, 0, .5) to that pixel: the .5 indicates the coverage and the (1, 0, 0) is the color. &lt;/div&gt;There are a few reasons to dismiss this proposal, the most severe being that all composting operations will involve multiplying the 1 in the red channel by the 0.5 in the alpha channel to compute the red contribution of this object at this pixel. 这种un-pre-multiplied alpah的表示方式的缺点是每次做compositing时候都需要乘以alpha. &lt;div&gt;The desire to avoid this multiplication points up a better solution, storing the &lt;b&gt;&lt;i&gt;pre-multiplied&lt;/i&gt;&lt;/b&gt; value in the color component, so that (0.5, 0, 0, 0.5) will indicate a full red object half covering a pixel."&lt;/div&gt;&lt;br /&gt;然后区分了两个:&lt;div&gt;black = (0, 0, 0, 1); // an opaque black, alpha = 1 means full coverage = opaque. &lt;/div&gt;&lt;div&gt;clear = (0, 0, 0, 0); // transparent.&lt;/div&gt;&lt;div&gt;什么是"clear"呢? 就是下面看到的格子背景(在gimp, photoshop中才能看到的). 我用红色的圈圈表示picker的位置. "transparent pixels cannot be displayed on a computer monitor", so a "checker board pattern" is used.&lt;br /&gt;&lt;div id="ua72" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_319f5m9q8fp_b" style="height:190.342541px;width:648px" /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;第4节 讲了12种composition operations. 这部分很难懂，需要参考[2],[3],&lt;/div&gt;&lt;div&gt;为什么说12种呢? 组合问题。&lt;/div&gt;&lt;div&gt;并且假如颜色是用了pre-multiplied的话, composition后的color and alpha components都是用 equation 1: c0 = c_a * F_a + c_b * F_b来求的。那个F_a, F_b在每一种operator中的取值都不一样，F的意思是"which indicate the extend of contribution of A and B" 跟alpha不是一样的.&lt;/div&gt;&lt;div&gt;"&lt;span style="font-family:'times new roman';"&gt;&lt;span style="font-size:100%;"&gt;It is important to note that the equations defined by the Porter and Duff paper are all defined to operate on color components that are premultiplied by their corresponding alpha components. &lt;/span&gt;&lt;/span&gt;"[5] 说Porter-Duff paper中的公式用到是color components are pre-multiplied.&lt;br /&gt;&lt;br /&gt;先回顾alpha value的意义啊：这个color component在这个pixel上覆盖了多少, 0表示没有覆盖, 1表示全覆盖.&lt;/div&gt;&lt;div&gt;例如一个pixel上有picture A和picture B两个color component (element) 同时出现了，A.alpha = 1, B.alpha = 1. 这并不conflict冲突的, A的color component full coverage this pixel, and B's color component full coverage this pixel too. 当我们做alpha blending时候我们会先假设一个在某一个上面, 例如A在B上面，如果A.alpha=1，那B就看不到了. &lt;b&gt;所以我感觉alpha 是说我覆盖占这个pixel多少了, 控制的是pixel的transparency&lt;/b&gt;. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;再来看over operator, paper p256左边最后几行的公式是:&lt;/div&gt;&lt;div&gt;cO = cA * Fa + cB * Fa, 然后查表(A over B)就可得到Fa and Fb的value，代入公式:&lt;br /&gt;&lt;/div&gt;&lt;div&gt;cO = cA * 1 + cB * (1 - aA) = cA + cB * (1 - aA)。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;这公式是不是就是看上去很像我们上面提到的simple alpha compositing/blending的线性插值的结果呢? 其实就是嘛。paper的“This is almost the wll used linear interpolation of foreground F with the background B&lt;/div&gt;&lt;div&gt;B' = F * a + B * (1 - a),&lt;/div&gt;&lt;div&gt;except that our foreground is pre-multiplied by alpha.” 公式中的a是指F.alpha, 我觉得.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Until now, 终于将我们平时看到的linear interpolation和Porter-Duffer paper中的over operator联系起来了. 另一个证明, 在[6]中有"&lt;span style="font-family:sans-serif;"&gt;&lt;span class="attr-value"&gt;&lt;b&gt;&lt;span style="font-size:100%;"&gt;'normal'&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; blend mode is equivalent to &lt;a href="http://www.w3.org/TR/SVG/filters.html#feCompositeOperatorAttribute" style="background-color:transparent;background-image:initial;color:#0000cc"&gt;&lt;span class="attr-value"&gt;&lt;b&gt;&lt;span style="font-size:100%;"&gt;operator="over"&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; on the &lt;a href="http://www.w3.org/TR/SVG/filters.html#feComposite" style="background-color:transparent;background-image:initial;color:#0000cc"&gt;&lt;span class="element-name"&gt;&lt;span style="color:#a52a2a;"&gt;&lt;b&gt;&lt;span style="font-size:100%;"&gt;'feComposite'&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; filter primitive, matches the blending method used by &lt;a href="http://www.w3.org/TR/SVG/filters.html#feMerge" style="background-color:transparent;background-image:initial;color:#0000cc"&gt;&lt;span class="element-name"&gt;&lt;span style="color:#a52a2a;"&gt;&lt;b&gt;&lt;span style="font-size:100%;"&gt;'feMerge'&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; and matches the &lt;a href="http://www.w3.org/TR/SVG/masking.html#SimpleAlphaBlending" style="background-color:transparent;background-image:initial;color:#0000cc"&gt;simple alpha compositing&lt;/a&gt; technique used in SVG for all compositing outside of filter effects.&lt;/span&gt;&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;&lt;div&gt;[1] Compositing Digital Image, 1984. &lt;a href="http://keithp.com/~keithp/porterduff/" style="color:#551a8b"&gt;http://keithp.com/~keithp/porterduff/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;[2] &lt;span style="font-family:times, serif;"&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="font-size:100%;"&gt;http://www.svgopen.org/2005/papers/abstractsvgopen/index.html&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;[3] &lt;span style="font-family:sans-serif;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Alpha_compositing" style="color:#551a8b"&gt;http://en.wikipedia.org/wiki/Alpha_compositing&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;[4] &lt;a href="http://greenshoes.free.fr/dotclear/index.php?post/2008/12/02/Using-alpha-composites-in-PulpCore"&gt;http://greenshoes.free.fr/dotclear/index.php?post/2008/12/02/Using-alpha-composites-in-PulpCore&lt;/a&gt;&lt;br /&gt;[5] &lt;a href="http://java.sun.com/javase/6/docs/api/java/awt/AlphaComposite.html"&gt;http://java.sun.com/javase/6/docs/api/java/awt/AlphaComposite.html&lt;/a&gt; 这里也有解释和公式. &lt;/div&gt;&lt;div&gt;[6] &lt;a href="http://www.w3.org/TR/SVG/filters.html#feBlend"&gt;http://www.w3.org/TR/SVG/filters.html#feBlend&lt;/a&gt; 这是SVG1.1 20030114.&lt;/div&gt;&lt;br /&gt;[ ] &lt;a href="http://www.mail-archive.com/gimp-developer@lists.xcf.berkeley.edu/msg08096.html"&gt;http://www.mail-archive.com/gimp-developer@lists.xcf.berkeley.edu/msg08096.html&lt;/a&gt; GIMP中多个layers时候也是从低往上来做composition的"the layer compositing works from the bottom to the top". 注意这种合并是非associative的，所以次序很关键.&lt;br /&gt;[ ] &lt;a href="https://mmack.wordpress.com/"&gt;https://mmack.wordpress.com/&lt;/a&gt; 里面的Sprite mipmaps文中将到pre-mulitplied 的另一个用处.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;上面讲了什么是pre-multiplied alpha，也提到了它的一个好处是不用在每次求compositing时候做乘以alpha value. 那么它还有什么好处呢? 这就是下一个话题了.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[] &lt;a href="http://www.kxcad.net/autodesk/3ds_max/Autodesk_3ds_Max_9_Reference/premultiplied_alpha_glossary.html"&gt;http://www.kxcad.net/autodesk/3ds_max/Autodesk_3ds_Max_9_Reference/premultiplied_alpha_glossary.html&lt;/a&gt;&lt;div&gt;[] &lt;a href="http://blogs.msdn.com/shawnhar/archive/2009/11/06/premultiplied-alpha.aspx"&gt;http://blogs.msdn.com/shawnhar/archive/2009/11/06/premultiplied-alpha.aspx&lt;/a&gt;&lt;/div&gt;&lt;div&gt;[] &lt;a href="http://blogs.msdn.com/shawnhar/archive/2010/04/09/how-shawn-learned-to-stop-worrying-and-love-premultiplied-alpha.aspx"&gt;http://blogs.msdn.com/shawnhar/archive/2010/04/09/how-shawn-learned-to-stop-worrying-and-love-premultiplied-alpha.aspx&lt;/a&gt;&lt;/div&gt;&lt;div&gt;[] &lt;a href="http://blogs.msdn.com/shawnhar/archive/2009/11/11/premultiplied-alpha-content-processor.aspx"&gt;http://blogs.msdn.com/shawnhar/archive/2009/11/11/premultiplied-alpha-content-processor.aspx&lt;/a&gt;&lt;/div&gt;&lt;div&gt;[] &lt;a href="http://home.comcast.net/~tom_forsyth/blog.wiki.html#[[Premultiplied%20alpha]]"&gt;http://home.comcast.net/~tom_forsyth/blog.wiki.html#[[Premultiplied%20alpha]]&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;当然了, 它也有缺点的. "To be clear: premultiplied alpha is not a perfect panacea for all problems".&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://www.kxcad.net/autodesk/3ds_max/Autodesk_3ds_Max_9_Reference/premultiplied_alpha_glossary.html"&gt;&lt;/a&gt;[] &lt;a href="http://kriscg.blogspot.com/2009/11/premultiplied-alpha.html"&gt;http://kriscg.blogspot.com/2009/11/premultiplied-alpha.html&lt;/a&gt;&lt;br /&gt;[] &lt;a href="http://msdnrss.thecoderblogs.com/2010/04/08/premultiplied-alpha-in-xna-game-studio-40/"&gt;http://msdnrss.thecoderblogs.com/2010/04/08/premultiplied-alpha-in-xna-game-studio-40/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;讲完了 what is premultiplied alpha and why it solves all the world's problems. 下面讲一下它跟blend mode的关系，其实我是因为要做blend mode的操作，而1. blend mode的某些操作中用到了over operator等；2. the formulas in that photoshop document are assuming the pixels are unpremultiplied. 3. Mudbox uses premultiplied alpha, so the math will be different in some cases. &lt;div&gt;才涉及到Porter-Duff Compositing的. 下面回归blend mode.&lt;/div&gt;&lt;br /&gt;首先, "&lt;span style="font-family:tahoma;"&gt;While every pixel has transparency information associated with it, every layer also has an associated &lt;b&gt;&lt;i&gt;opacity&lt;/i&gt;&lt;/b&gt; value. The two terms are similar and in most cases can be treated as the same. You may think of a layer's opacity value as a "dimmer" for the alpha values of every pixel in the layer.&lt;/span&gt;"&lt;a href="http://www.getpaint.net/doc/latest/en/LayersAndBlendModes.html"&gt;http://www.getpaint.net/doc/latest/en/LayersAndBlendModes.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.getpaint.net/doc/latest/en/LayersAndBlendModes.html"&gt;&lt;/a&gt;下图说明Opacity是layer的属性, alpha是pixel的属性. 合成时候貌似是:&lt;/div&gt;&lt;div&gt;先f' = foreground image * opacity，再来用这个f'去继续的.&lt;/div&gt;&lt;div id="z3tb" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_320czkgw5ft_b" style="height:582.023529px;width:1024px" /&gt;&lt;/div&gt;&lt;br /&gt;svg的specifications都是用pre-multiplied的.&lt;br /&gt;在svg 1.1 中[&lt;a href="http://www.w3.org/TR/SVG11/filters.html#feBlend"&gt;http://www.w3.org/TR/SVG11/filters.html#feBlend&lt;/a&gt;, &lt;a href="http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feBlend"&gt;http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feBlend&lt;/a&gt; 这两个是一样的]中可以找到normal, multiply, screen, darken, lighten的公式，都是premultiplied的, 相关的实现在google code search中找nr-filter-blend.cpp 可以找到。是不是意味着在svg 1.1中只是支持这5个Porter-Duff操作呢? 后面提到1.2版本做了扩展的.&lt;div&gt;在svg filter 1.2 [&lt;a href="http://www.w3.org/TR/2007/WD-SVGFilter12-20070501/#feBlendElement"&gt;http://www.w3.org/TR/2007/WD-SVGFilter12-20070501/#feBlendElement&lt;/a&gt;] 中也一样，&lt;br /&gt;但是在svg 1.2[&lt;a href="http://www.w3.org/TR/2004/WD-SVG12-20041027/rendering.html"&gt;http://www.w3.org/TR/2004/WD-SVG12-20041027/rendering.html&lt;/a&gt;]就好像对alpha compositing做了扩展，加入了Compositing module. &lt;/div&gt;&lt;div&gt;[&lt;a href="http://www.svgopen.org/2005/papers/abstractsvgopen/"&gt;http://www.svgopen.org/2005/papers/abstractsvgopen/&lt;/a&gt;]里面有一些介绍和解释。&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;这里给我的感觉就是后续的出现在PDF specification中的其它例如darken/lighten, soft light等都是Porter-Duffer 之后的扩展, 如上说的Normal mode就是Over operator. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;上面那是svg的specifications, 至于具体在一个library中怎么实现，那还是有区别的. &lt;/div&gt;&lt;br /&gt;下面看看Cairo的实现(它利用了一个叫做Pixman: the pixel-manipulation library for X and cairo的库).&lt;br /&gt;&lt;br /&gt;&lt;div&gt;首先, 貌似是Benjamin Otte这家伙(后来在red hat中上班)在Cairo中加入blend mode的(March 2008, &lt;a href="http://old.nabble.com/Blend-modes-td15856879.html"&gt;http://old.nabble.com/Blend-modes-td15856879.html&lt;/a&gt; ), 然后他发现了SVG标准中的soft-light mode跟PDF中描述的algorithm不一样，所以在October 2008就给SVG提了个建议:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;下面就是Benjamin提出问题的地方.&lt;/div&gt;&lt;div&gt;&lt;a href="http://lists.w3.org/Archives/Public/www-svg/2008Oct/0029.html" style="color:#551a8b"&gt;http://lists.w3.org/Archives/Public/www-svg/2008Oct/0029.html&lt;/a&gt; Benjamin在这mailing list里提了问题 (然后被SVG里面的人 raised as issue 2095). 顺着这个mailing list下去会看到有人会回应的, 在&lt;a href="http://lists.w3.org/Archives/Public/www-svg/2008Oct/"&gt;http://lists.w3.org/Archives/Public/www-svg/2008Oct/&lt;/a&gt; 页面中搜索blend 或者 soft关键字，一直到2009年Feb 12号的&lt;a href="http://lists.w3.org/Archives/Public/public-svg-wg/2009JanMar/0132.html"&gt;http://lists.w3.org/Archives/Public/public-svg-wg/2009JanMar/0132.html&lt;/a&gt;. &lt;/div&gt;&lt;br /&gt;[之后被raised 作为issue 2095], 后面有人跟进:&lt;br /&gt;&lt;span style="font-family:arial, sans-serif;"&gt;&lt;span style="color:#228822;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://markmail.org/message/f4tsfvm2wjevxyh6#query:+page:1+mid:vuxzgn53rls7aq3o+state:results"&gt;http://markmail.org/message/f4tsfvm2wjevxyh6#query:+page:1+mid:vuxzgn53rls7aq3o+state:results&lt;/a&gt; &lt;span style="color:#000000;"&gt;这里面Alex Danilo的回答&lt;span style="font-family:Verdana;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana;"&gt;while I was working on this, we had to deduce the functions from various sources, since the equations were not published. The starting point was some Japanese site that had reverse engineered the equations from looking at Photoshop. We extended the base equations to include alpha correctly.&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana;"&gt;" 可见SVG初始的实现(2002年)是对Photoshop做逆向工程得到的, 而且考虑了pre-multiplied alpha, 然&lt;/span&gt;后Alex他还给出了soft-light的公式(可能是逆向工程得到的, 这公式就是上面提到的svg 1.2 &lt;a href="http://www.w3.org/TR/2004/WD-SVG12-20041027/rendering.html"&gt;http://www.w3.org/TR/2004/WD-SVG12-20041027/rendering.html&lt;/a&gt;中所用的公式). 之后Benjamin又给出了他根据PDF specification推导的公式(这公式就是他在pixman-combine32.c代码中所用的), 后来Anthony Grasso&lt;span style="font-family:Arial, Helvetica, 'Luxi Sans', sans-serif;"&gt; 在2009 Feb 12又给出了他根据PDF specification推导的公式, &lt;/span&gt; 讨论时候还提到的 Color Dodge and Color Burn的公式，Benjamin和Anthony对这两个公式是没有异议的.  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;他们SVG Working Group 后来还在Teleconference中提到了这个问题, 在&lt;a href="http://www.w3.org/2009/02/16-svg-minutes.html"&gt;http://www.w3.org/2009/02/16-svg-minutes.html&lt;/a&gt; 页面中找soft-light关键字.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;他们比较完整的email整理在&lt;a href="http://www.w3.org/Graphics/SVG/WG/track/issues/2095"&gt;http://www.w3.org/Graphics/SVG/WG/track/issues/2095&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;上面的公式都是从un-pre-multiplied格式中他们自己推导过去的，原始的公式和参考文档Benjamin Otte在:&lt;/div&gt;&lt;a href="http://lists.freedesktop.org/archives/cairo/2008-October/015362.html"&gt;http://lists.freedesktop.org/archives/cairo/2008-October/015362.html&lt;/a&gt; 里面提到Adobe PDF specification分别是[&lt;span style="font-family:Courier New;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="https://docs.google.com/viewer?url=http%3A%2F%2Fwww.adobe.com%2Fdevnet%2Facrobat%2Fpdfs%2FPDF32000_2008.pdf"&gt;http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf&lt;/a&gt; chapter 11&lt;/span&gt;&lt;/span&gt;] and [&lt;span style="font-family:Courier New;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="https://docs.google.com/viewer?url=http%3A%2F%2Fwww.adobe.com%2Fdevnet%2Fpdf%2Fpdfs%2Fblend_modes.pdf"&gt;http://www.adobe.com/devnet/pdf/pdfs/blend_modes.pdf&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;] 估计Photoshop也是类似的算法.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;GIMP, 18 Oct 2008也对Benjamin的实现有点兴趣，于是有了&lt;a href="http://www.mail-archive.com/xorg@lists.freedesktop.org/msg01141.html"&gt;http://www.mail-archive.com/xorg@lists.freedesktop.org/msg01141.html&lt;/a&gt;，他们也支持svg 1.2中使用的公式有点旧了, 而PDF specification是2008年出来，更新一点. 而且他们讨论了觉得大部分的formula都是对的，那两个来自Flash的Invent和谁是PDF spec里面没有的.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;至于推导公式的细节，就找不到了. 自己做一下试试.&lt;br /&gt;首先，在PDF32000_2008(所谓的PDF Spec)P322中给出了basic (colour) compositing formula:&lt;/div&gt;&lt;div id="xgu1" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_323d57brwhd_b" style="height:64px;width:556px" /&gt;&lt;/div&gt;然后在P328中说"The preceding formula represents a simplification of the following formula, which presents the relative contributions of backdrop, source, and blended colours in a more straightforward way":&lt;br /&gt;&lt;div id="y6_v" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_324d4rvxmgm_b" style="height:53px;width:595px" /&gt;&lt;/div&gt;这公式其实更好，为什么呢？&lt;div&gt;我暂时觉得有两个原因. &lt;/div&gt;&lt;div&gt;1. 例如我们已经画好了backdrop，然后在上面多加一个source(以layer形式出现), 并且这个source中不是整个图片都是有painting结果的(例如这个layer是用stroke做painting画出来的), 在stroking不到的部位就为clear(0,0,0,0)全透明full transparency.  看下面我在GIMP中例子:&lt;br /&gt;&lt;div id="uee7" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_325gknr45cn_b" style="height:369px;width:625px" /&gt;&lt;/div&gt;&lt;div id="m0xp" style="text-align:left"&gt;图中有two layers, 上面一个作为source layer它的大部分区域都是全透明的，alpha=0, 注意它的color component=(0,0,0)是黑色，假如我们做blending时候用到了这个黑色的话，那效果就不好了，因为本来它是全透明的，底线的background应该不受影响的.&lt;/div&gt;&lt;div id="q49." style="text-align:left"&gt;那么上面的p328的公式就比p322的公式更准确了. &lt;/div&gt;2. p328的公式前半部分更容易转化为pre-multiplied alpha的形式. 看下图:&lt;/div&gt;&lt;div id="d4q5" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_326cs4ms9g8_b" style="height:318px;width:595px" /&gt;&lt;/div&gt;其实在pixman-combine32.c代码中， &lt;span style="font-family:arial, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;Benjamin做实现时候大部分的blend mode就是用了pre-multiplied format的blending mode function. 然后&lt;span style="font-family:arial, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;Color, Luminosity, Saturation, Hue这四种blend mode是例外, 还是照着PDF一样用non-premultiplied colors. 前者和否则分别对应他代码中的&lt;span style="font-family:Courier New;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span class="stx-macro"&gt;&lt;span style="color:#880000;"&gt;PDF_SEPARABLE_BLEND_MODE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;和&lt;span style="font-family:Courier New;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span class="stx-macro"&gt;&lt;span style="color:#880000;"&gt;PDF_NON_SEPARABLE_BLEND_MODE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;。&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span style="font-family:arial, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;我需要猜懂他为什么得到这样的结果，并且在上面也说了对于soft light 也要格外小心 “&lt;span style="font-family:arial, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;Anthony Grasso&lt;/span&gt;&lt;span style="font-family:Arial, Helvetica, 'Luxi Sans', sans-serif;"&gt; 在2009 Feb 12又给出了他根据PDF specification推导的公式&lt;/span&gt;&lt;/span&gt;”。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;有一点其实挺奇怪的是，上面的pre-multiplied format公式中前面的一部分就是Porter-Duff paper中的XOR operator, 应该不是巧合coincidence吧，是什么原因呢?&lt;br /&gt;&lt;br /&gt;&lt;div id="tcpr" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_327hr354jhg_b" style="height:622.368356px;width:648px" /&gt;pic,   pic,    &lt;/div&gt;&lt;div id="gdoe" style="text-align:left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="a:o5" style="text-align:left"&gt;上面列举了几个简单的blend mode 从non-premultiplied 到 premultiplied的转化，下面看看复杂一点的例子soft light blend mode.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="comment"&gt;// B is the backdrop image, S is the source layer image.&lt;br /&gt;&lt;/span&gt;float3 Bca&lt;span class="operator"&gt; =&lt;/span&gt; backdrop&lt;span class="operator"&gt;.&lt;/span&gt;rgb&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="type"&gt; float&lt;/span&gt; Ba&lt;span class="operator"&gt; =&lt;/span&gt; backdrop&lt;span class="operator"&gt;.&lt;/span&gt;a&lt;span class="operator"&gt;;&lt;/span&gt;&lt;br /&gt;float3 Sca&lt;span class="operator"&gt; =&lt;/span&gt; source&lt;span class="operator"&gt;.&lt;/span&gt;rgb&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="type"&gt; float&lt;/span&gt; Sa&lt;span class="operator"&gt; =&lt;/span&gt; source&lt;span class="operator"&gt;.&lt;/span&gt;a&lt;span class="operator"&gt;;&lt;/span&gt;&lt;br /&gt;float3 tmp&lt;span class="operator"&gt; =&lt;/span&gt; Bca&lt;span class="operator"&gt; * (&lt;/span&gt;&lt;span class="int"&gt;1&lt;/span&gt;&lt;span class="operator"&gt; -&lt;/span&gt; Sa&lt;span class="operator"&gt;) +&lt;/span&gt; Sca&lt;span class="operator"&gt; * (&lt;/span&gt;&lt;span class="int"&gt;1&lt;/span&gt;&lt;span class="operator"&gt; -&lt;/span&gt; Ba&lt;span class="operator"&gt;);&lt;/span&gt;&lt;span class="flow"&gt;&lt;br /&gt;&lt;br /&gt;if&lt;/span&gt;&lt;span class="operator"&gt; (&lt;/span&gt;Ba&lt;span class="operator"&gt; &amp;lt;&lt;/span&gt;&lt;span class="float"&gt; 0.001&lt;/span&gt;&lt;span class="operator"&gt; ||&lt;/span&gt; Sa&lt;span class="operator"&gt; &amp;lt;&lt;/span&gt;&lt;span class="float"&gt; 0.001&lt;/span&gt;&lt;span class="operator"&gt;) {&lt;/span&gt;&lt;span class="comment"&gt;&lt;br /&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;// when either Ba and Sa is zero, Ba * Sa * Blend(Bc, Sc) = 0.&lt;br /&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;// so the color is XOR of Bca and Sca, which is the current tmp value.&lt;br /&gt;&lt;/span&gt;&lt;span class="operator"&gt;}&lt;/span&gt;&lt;span class="flow"&gt; else&lt;/span&gt;&lt;span class="operator"&gt; {&lt;/span&gt;&lt;span class="flow"&gt;&lt;br /&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;if&lt;/span&gt;&lt;span class="operator"&gt; (&lt;/span&gt;&lt;span class="int"&gt;2&lt;/span&gt;&lt;span class="operator"&gt; *&lt;/span&gt; Sca&lt;span class="operator"&gt;.&lt;/span&gt;r&lt;span class="operator"&gt; &amp;lt;=&lt;/span&gt; Sa&lt;span class="operator"&gt; &amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="int"&gt; 2&lt;/span&gt;&lt;span class="operator"&gt; *&lt;/span&gt; Sca&lt;span class="operator"&gt;.&lt;/span&gt;g&lt;span class="operator"&gt; &amp;lt;=&lt;/span&gt; Sa&lt;span class="operator"&gt; &amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="int"&gt; 2&lt;/span&gt;&lt;span class="operator"&gt; *&lt;/span&gt; Sca&lt;span class="operator"&gt;.&lt;/span&gt;b&lt;span class="operator"&gt; &amp;lt;=&lt;/span&gt; Sa&lt;span class="operator"&gt;) {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;tmp&lt;span class="operator"&gt; +=&lt;/span&gt; Bca&lt;span class="operator"&gt; *&lt;/span&gt; Sa&lt;span class="operator"&gt; - (&lt;/span&gt;Sa&lt;span class="operator"&gt; -&lt;/span&gt;&lt;span class="int"&gt; 2&lt;/span&gt;&lt;span class="operator"&gt;*&lt;/span&gt;Sca&lt;span class="operator"&gt;) *&lt;/span&gt; Bca&lt;span class="operator"&gt; * (&lt;/span&gt;&lt;span class="int"&gt;1&lt;/span&gt;&lt;span class="operator"&gt; -&lt;/span&gt; Bca&lt;span class="operator"&gt;/&lt;/span&gt;Ba&lt;span class="operator"&gt;);&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;span class="flow"&gt; else&lt;/span&gt;&lt;span class="operator"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;float3 D&lt;span class="operator"&gt;;&lt;/span&gt;&lt;span class="flow"&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if&lt;/span&gt;&lt;span class="operator"&gt; (&lt;/span&gt;&lt;span class="int"&gt;4&lt;/span&gt;&lt;span class="operator"&gt; *&lt;/span&gt; Bca&lt;span class="operator"&gt;.&lt;/span&gt;r&lt;span class="operator"&gt; &amp;lt;=&lt;/span&gt; Ba&lt;span class="operator"&gt; &amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="int"&gt; 4&lt;/span&gt;&lt;span class="operator"&gt; *&lt;/span&gt; Bca&lt;span class="operator"&gt;.&lt;/span&gt;g&lt;span class="operator"&gt; &amp;lt;=&lt;/span&gt; Ba&lt;span class="operator"&gt; &amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="int"&gt; 4&lt;/span&gt;&lt;span class="operator"&gt; *&lt;/span&gt; Bca&lt;span class="operator"&gt;.&lt;/span&gt;b&lt;span class="operator"&gt; &amp;lt;=&lt;/span&gt; Ba&lt;span class="operator"&gt;) {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;D&lt;span class="operator"&gt; = ((&lt;/span&gt;&lt;span class="int"&gt;16&lt;/span&gt;&lt;span class="operator"&gt;*&lt;/span&gt;Bca&lt;span class="operator"&gt;/&lt;/span&gt;Ba&lt;span class="operator"&gt; -&lt;/span&gt;&lt;span class="int"&gt; 12&lt;/span&gt;&lt;span class="operator"&gt;) *&lt;/span&gt; Bca&lt;span class="operator"&gt;/&lt;/span&gt;Ba&lt;span class="operator"&gt; +&lt;/span&gt;&lt;span class="int"&gt; 4&lt;/span&gt;&lt;span class="operator"&gt;) *&lt;/span&gt; Bca&lt;span class="operator"&gt;;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;span class="flow"&gt; else&lt;/span&gt;&lt;span class="operator"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;D&lt;span class="operator"&gt; =&lt;/span&gt; sqrt&lt;span class="operator"&gt;(&lt;/span&gt;Bca&lt;span class="operator"&gt; *&lt;/span&gt; Ba&lt;span class="operator"&gt;);&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;tmp&lt;span class="operator"&gt; +=&lt;/span&gt; Bca&lt;span class="operator"&gt; *&lt;/span&gt; Sa&lt;span class="operator"&gt; + (&lt;/span&gt;&lt;span class="int"&gt;2&lt;/span&gt;&lt;span class="operator"&gt; *&lt;/span&gt; Sca&lt;span class="operator"&gt; -&lt;/span&gt; Sa&lt;span class="operator"&gt;) * (&lt;/span&gt;D&lt;span class="operator"&gt; -&lt;/span&gt; Bca&lt;span class="operator"&gt;);&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;span class="type"&gt;&lt;br /&gt;float&lt;/span&gt; alpha&lt;span class="operator"&gt; =&lt;/span&gt; UnionOp&lt;span class="operator"&gt;(&lt;/span&gt;Ba&lt;span class="operator"&gt;,&lt;/span&gt; Sa&lt;span class="operator"&gt;);&lt;/span&gt;&lt;span class="comment"&gt; //Õâ¶«Î÷ºóÃæ»á½²µ½.&lt;br /&gt;&lt;/span&gt;float4 result&lt;span class="operator"&gt; =&lt;/span&gt; float4&lt;span class="operator"&gt;(&lt;/span&gt;tmp&lt;span class="operator"&gt;,&lt;/span&gt; alpha&lt;span class="operator"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;再回去看看那个XOR operator是怎么回事，下面看看假如Rca = XOR(Bca, Ba, Sca, Sa)的效果:&lt;/div&gt;&lt;br /&gt;&lt;div id="gqj0" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_329cm9mkthn_b" style="height:460.267148px;width:648px" /&gt;&lt;/div&gt;&lt;br /&gt;这样就很直观了，感觉好像就是Layer 全透明(full transparency, clear(0,0,0,0))的地方不影响背景, 公式中解释为Sa = 0, 所以(1 - Sa) * Bca + (1 - Ba) * Sa= (1 - 0) * Bca + (1 - Ba) * (0,0,0) = Bca; 而Layer中非透明的地方，就不好直观地说了，要代入公式来算了。这本例中因为非透明的地方Ba = Sa = 1, 所以结果是(0,0,0)黑色.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;上面解决了怎么从basic (colour) compositing formula中求出colour, 在PDF spec chapter 11.3.7.3中讲了result alpha的求法:&lt;/div&gt;&lt;div&gt;Ra = union(Sa, Ba) = Ba + Sa - (Ba * Sa). &lt;/div&gt;&lt;div&gt;这公式很像求color时候用的scree blend mode.  “The result tends toward 1.0: if either input is 1.0, the result is 1.0”.&lt;/div&gt;&lt;br /&gt;于是最后的结果应该就是: (Rca, Ra), in premultiplied format.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;扩展:&lt;br /&gt;&lt;div&gt;Quartz 2D是  mac/iphone上的graphics render engine, 不开源的, &lt;/div&gt;&lt;div&gt;&lt;a href="http://developer.apple.com/mac/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_paths/dq_paths.html"&gt;http://developer.apple.com/mac/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_paths/dq_paths.html&lt;/a&gt; 页面中找"blend mode" 可看到介绍.&lt;/div&gt;&lt;br /&gt;Cairo 是跨平台的, 应用广泛，例如在Mozilla Firefox, GTK/Gnome, OpenOffice中用到了,&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://cairographics.org/operators"&gt;http://cairographics.org/operators&lt;/a&gt; 这是blend mode的例子.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SKia图形引擎, 在Google Chrome/Android中用到了. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-8355314833119675697?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/8355314833119675697/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/05/premultiplied-alpha.html#comment-form' title='1 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8355314833119675697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8355314833119675697'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/05/premultiplied-alpha.html' title='premultiplied alpha'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-8849237424110624248</id><published>2010-04-25T13:59:00.002+08:00</published><updated>2010-05-08T13:18:00.586+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mesh'/><category scheme='http://www.blogger.com/atom/ns#' term='tech'/><category scheme='http://www.blogger.com/atom/ns#' term='laplacian'/><category scheme='http://www.blogger.com/atom/ns#' term='editting'/><category scheme='http://www.blogger.com/atom/ns#' term='reading notes'/><title type='text'>Laplacian Mesh Processing</title><content type='html'>&lt;div&gt;&lt;a href="http://cs.nyu.edu/~sorkine/ProjectPages/Editing/STAR68.pdf" id="e030" title="Laplacian Mesh Processing"&gt;Laplacian Mesh Processing&lt;/a&gt; Olga Sorkine, EuroGraphics '05, State of The Art Report&lt;br /&gt;&lt;/div&gt;&lt;div&gt;用Laplacian operator 来 differential surface representation of a mesh: &lt;/div&gt; vertex position vi=(xi, yi, zi) is &lt;b&gt;Cartesian coordinate&lt;/b&gt; defined Cartesian space, &lt;div&gt;we can define a &lt;b&gt;&lt;span style="color:#FF9900;"&gt;differential coordinate&lt;/span&gt;&lt;/b&gt; of vi in differential space:&lt;/div&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_315fkdhkqdk_b" style="float:left;height:247.179487px;margin-left:0px;margin-right:1em;width:480px" /&gt;将所有顶点放一个n*1的向量中，将这个Laplace operator放到一个n * n的Ls matrix中，就可以表示整个mesh的Laplacian coordinate.&lt;br /&gt;&lt;br /&gt;从两个角度来看这个Ls matrix。 &lt;div&gt;角度 1. 可以called the topological (or graph) Laplacian of the mesh. 它具有的一些properties例如：&lt;/div&gt; Ls matrix is singular, we can't restore the global coordinates only given a set of laplacian-coordinates. 为了解决这个问题，在Ls这个symmetric matrix中加入constraints，成为一个least-squares equations.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;角度 2. from a differential geometry perspective this coordinates can  be views a discretization of the continuous Laplace-Beltrami operator[dC76], if we assume that our mesh is a piecewise-linear approximation of a smooth surface. 见Fig 1.&lt;br /&gt;文中还提到geometric discretizations fo the Laplacian have better approximation qualities. 这里所谓的逼近是对假设的那个smooth surface来说的。列举的两种geometric discretizations包括:&lt;br /&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_316dmff68gt_b" style="float:left;height:226.171575px;margin-left:0px;margin-right:1em;width:480px" /&gt; &lt;br /&gt;reference:&lt;br /&gt;&lt;div&gt;&lt;a href="http://www.cs.caltech.edu/~mmeyer/Publications/diffGeomOps.pdf" id="p1t4" title="Discrete Differential-Geometry Operators for Triangulated 2-Manifolds"&gt;Discrete Differential-Geometry Operators for Triangulated 2-Manifolds&lt;/a&gt;, Mark Meyer1, Mathieu Desbrun1,2, Peter Schr¨oder1, and Alan H. Barr1, &lt;/div&gt;&lt;br /&gt;&lt;a href="http://heim.ifi.uio.no/michaelf/papers/mean_value.pdf" id="w3w5" title="Mean Value Coordinates"&gt;Mean Value Coordinates&lt;/a&gt;, &lt;a href="http://home.ifi.uio.no/michaelf/papers/mv3d.pdf" id="cbs3" title="Mean value coordinates in 3D"&gt;Mean value coordinates in 3D&lt;/a&gt;,&lt;br /&gt;&lt;a href="http://home.ifi.uio.no/michaelf/papers/papers.html" id="lhfz" title="M. S. Floater"&gt;M. S. Floater&lt;/a&gt;. 里面很多跟MVC有关的paper.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://graphics.stanford.edu/courses/cs468-05-fall/slides/tarang_mvc_fall_05.pdf" id="lmfm" title="MVC 在‘05被用作deformation了"&gt;MVC 在‘05被用作deformation了&lt;/a&gt;, Mean Value Coordinates for Closed Triangular Meshes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;其实跟Laplacian Operation相关的工作挺多了，还有&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;b&gt;Laplacian Mesh Optimization, &lt;/b&gt;Andrew Nealen, Olga Sorkine and Macr Alexa. 详细的请找Olgo Sorkine的主页. &lt;/span&gt; &lt;/div&gt;&lt;br /&gt;&lt;span class="post-labels"&gt; 标签： &lt;a href="http://rencanjiang.blogspot.com/search/label/reading" rel="tag"&gt;reading&lt;/a&gt;, &lt;a href="http://rencanjiang.blogspot.com/search/label/tech" rel="tag"&gt;tech&lt;/a&gt;, &lt;a href="http://rencanjiang.blogspot.com/search/label/mesh" rel="tag"&gt;mesh&lt;/a&gt;, &lt;a href="http://rencanjiang.blogspot.com/search/label/laplacian" rel="tag"&gt;laplacian&lt;/a&gt;, &lt;a href="http://rencanjiang.blogspot.com/search/label/editting" rel="tag"&gt;editting&lt;/a&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-8849237424110624248?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/8849237424110624248/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/04/laplacian-mesh-processing.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8849237424110624248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8849237424110624248'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/04/laplacian-mesh-processing.html' title='Laplacian Mesh Processing'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-9199824507298910830</id><published>2010-04-21T22:15:00.001+08:00</published><updated>2010-04-21T22:15:20.750+08:00</updated><title type='text'>2010-3-9 有趣的东西-voxel sculptiing</title><content type='html'>&lt;font face="arial, tahoma, verdana"&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;&lt;a href="http://www.3d-coat.com/voxel-sculpting/" style="color:#a91b33;text-decoration:none"&gt;http://www.3d-coat.com/voxel-sculpting/&lt;/a&gt;&lt;br&gt;&amp;#35835;&amp;#23436;&amp;#37324;&amp;#38754;&amp;#30340;&amp;#20171;&amp;#32461;&amp;#20043;&amp;#21518;&amp;#65292;&amp;#24819;&amp;#27861;&amp;#26159;&amp;#65306;&lt;br&gt;1. &amp;#26354;&amp;#32447;&amp;#26354;&amp;#38754;&amp;#20248;&amp;#21183;&amp;#26159;&amp;#31934;&amp;#30830;&amp;#24230;precision, &amp;#32570;&amp;#28857;&amp;#26159;(&amp;#22914;&amp;#26524;&amp;#31639;&amp;#26159;&amp;#32570;&amp;#28857;&amp;#30340;&amp;#35805;)&amp;#24314;&amp;#27169;&amp;#30340;&amp;#20154;&amp;#35201;&amp;#23545;&amp;#25972;&amp;#20010;&amp;#27169;&amp;#22411;&amp;#26377;&amp;#20840;&amp;#23616;&amp;#30340;&amp;#25484;&amp;#25569;&amp;#65292;&amp;#20363;&amp;#22914;&amp;#37027;&amp;#37324;&amp;#26159;&amp;#19968;&amp;#20010;&amp;#35282;&amp;#21738;&amp;#37324;&amp;#26159;&amp;#19968;&amp;#20010;&amp;#24367;&amp;#21738;&amp;#37324;&amp;#26159;&amp;#19968;&amp;#20010;&amp;#27934;&amp;#65292;&amp;#32780;&amp;#19988;&amp;#35201;&amp;#23545;bezier/nurbs&amp;#30340;&amp;#29305;&amp;#24615;&amp;#36825;&amp;#20010;&amp;#24037;&amp;#20855;&amp;#24456;&amp;#29702;&amp;#35299;&amp;#25165;&amp;#33021;&amp;#29992;&amp;#22909;&amp;#36825;&amp;#20010;&amp;#24037;&amp;#20855;&amp;#12290;&lt;br&gt;2. &amp;#19977;&amp;#35282;&amp;#24418;/&amp;#22235;&amp;#36793;&amp;#24418;&amp;#65292;&amp;#25105;&amp;#35273;&amp;#24471;&amp;#26368;&amp;#22823;&amp;#30340;&amp;#20248;&amp;#21183;&amp;#22312;&amp;#20110;&amp;#30452;&amp;#35266;&amp;#32780;&amp;#19988;&amp;#24403;&amp;#21069;&amp;#30340;&amp;#26174;&amp;#21345;&amp;#37117;&amp;#26159;&amp;#23545;&amp;#19977;&amp;#35282;&amp;#24418;&amp;#28210;&amp;#26579;&amp;#20570;&amp;#20248;&amp;#21270;&amp;#36807;&amp;#30340;&amp;#12290;&amp;#20363;&amp;#22914;&amp;#20197;&amp;#21069;NVIDIA&amp;#23601;&amp;#20570;&amp;#36807;&amp;#23545;&amp;#22235;&amp;#36793;&amp;#24418;&amp;#28210;&amp;#26579;&amp;#20570;&amp;#20248;&amp;#21270;&amp;#30340;&amp;#12290;&amp;#25152;&amp;#35859;&amp;#30452;&amp;#35266;&amp;#65306;&amp;#29289;&amp;#20307;&amp;#30340;&amp;#34920;&amp;#38754;&amp;#37117;&amp;#26159;&amp;#29992;&amp;#24179;&amp;#38754;&amp;#26469;&amp;#34920;&amp;#31034;&amp;#65292;&amp;#24367;&amp;#26354;&amp;#30340;&amp;#22320;&amp;#26041;&amp;#29992;&amp;#22810;&amp;#19968;&amp;#28857;&amp;#23567;&amp;#30340;&amp;#24179;&amp;#38754;&amp;#23601;&amp;#22909;&amp;#20102;&amp;#12290;&amp;#20294;&amp;#26159;&amp;#36825;&amp;#20123;polygon&amp;#32452;&amp;#25104;&amp;#30340;mesh&amp;#65292;&amp;#31163;&amp;#19981;&amp;#24320;topology&amp;#12290;&amp;#24314;&amp;#27169;&amp;#30340;&amp;#20154;&amp;#35201;&amp;#24819;&amp;#30528;&amp;#25490;&amp;#32447;&amp;#24590;&amp;#20040;&amp;#25165;&amp;#22909;&amp;#65292;&amp;#24590;&amp;#20040;&amp;#25165;&amp;#35753;&amp;#22235;&amp;#36793;&amp;#24418;&amp;#30340;valences&amp;#23569;&amp;#19968;&amp;#28857;&amp;#12290;&amp;#25105;&amp;#20204;&amp;#21602;&amp;#65292;&amp;#24819;&amp;#30528;&amp;#24590;&amp;#20040;&amp;#20943;&amp;#23569;&amp;#36793;(simplification)&amp;#65292;&amp;#24590;&amp;#20040;&amp;#37325;&amp;#26032;&amp;#25490;&amp;#36825;&amp;#20123;&amp;#36793;(quadrangle)&amp;#65292;&amp;#36824;&amp;#26377;&amp;#24819;&amp;#30528;&amp;#24590;&amp;#20040;&amp;#21152;&amp;#19968;&amp;#20123;&amp;#36793;(subdivision)&amp;#31561;&amp;#31561;&amp;#65292;&amp;#35980;&amp;#20284;&amp;#37117;&amp;#26159;&amp;#22312;&amp;#20570;&amp;#36825;&amp;#20010;topology&amp;#12290;&amp;#37027;&amp;#22914;&amp;#26524;topology&amp;#30340;&amp;#29983;&amp;#25104;&amp;#21482;&amp;#26159;&amp;#22312;&amp;#24314;&amp;#27169;&amp;#30340;&amp;#26368;&amp;#21518;&amp;#19968;&amp;#20010;&amp;#38454;&amp;#27573;&amp;#21602;&amp;#65311;&lt;br&gt;3. &amp;#36825;&amp;#23601;&amp;#26469;&amp;#21040;&amp;#20102;voxel&amp;#20102;&amp;hellip;&amp;hellip;&amp;#26377;&amp;#36825;&amp;#20040;&amp;#19968;&amp;#20010;&amp;#38382;&amp;#39064;&amp;#65306;&amp;#22914;&amp;#26524;&amp;#20320;&amp;#21487;&amp;#20197;&amp;#23545;&amp;#29992;voxel&amp;#32452;&amp;#25104;&amp;#30340;object(&amp;#27880;&amp;#24847;&amp;#19981;&amp;#26159;&amp;#21483;mesh&amp;#20102;&amp;#21734;)&amp;#20570;&amp;#21160;&amp;#30011;(voxel&amp;#30340;&amp;#20803;&amp;#32032;&amp;#19981;&amp;#21464;&amp;#65292;&amp;#21482;&amp;#26377;&amp;#20301;&amp;#31227;?)&amp;#65292;&amp;#37027;&amp;#26159;&amp;#19981;&amp;#26159;&amp;#24456;&amp;#26032;&amp;#21602;&amp;#65311;&lt;br&gt;BTW, &amp;#20170;&amp;#22825;sh&amp;#19979;&amp;#38634;&amp;#65292;&amp;#28459;&amp;#22825;&amp;#32439;&amp;#39134;&amp;#65292;&amp;#24324;&amp;#24471;&amp;#25972;&amp;#20010;&amp;#19990;&amp;#30028;&amp;#37117;&amp;#20687;&amp;#26159;voxel&amp;#32452;&amp;#25104;&amp;#30340;&amp;#65292;&amp;#21482;&amp;#26159;&amp;#23494;&amp;#24230;&amp;#19981;&amp;#19968;&amp;#26679;&amp;#12290;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-9199824507298910830?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/9199824507298910830/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/04/2010-3-9-voxel-sculptiing.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/9199824507298910830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/9199824507298910830'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/04/2010-3-9-voxel-sculptiing.html' title='2010-3-9 有趣的东西-voxel sculptiing'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-179663993654897941</id><published>2010-04-21T22:06:00.001+08:00</published><updated>2010-04-21T22:06:18.078+08:00</updated><title type='text'>2010-4-8 有趣的-有问题的</title><content type='html'>&lt;p style="margin-left:0px;margin-right:0px"&gt;&lt;font face="arial, tahoma, verdana"&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Mari-&amp;#20570;&amp;#38463;&amp;#20961;&amp;#36798;&amp;#30340;3d painting&amp;#36719;&amp;#20214;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-left:0px;margin-right:0px"&gt;&lt;font face="arial, tahoma, verdana"&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;http://media.fxguide.com/fxguidetv/fxguidetv-ep078.mov&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-left:0px;margin-right:0px"&gt;&lt;font face="arial, tahoma, verdana"&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;&amp;#25105;&amp;#22909;&amp;#22855;&amp;#26032;&amp;#35199;&amp;#20848;&amp;#36825;&amp;#20010;&amp;#23567;&amp;#23567;&amp;#23567;&amp;#22269;&amp;#23478;&amp;#36825;&amp;#20040;&amp;#26377;&amp;#21019;&amp;#24847;:-)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-left:0px;margin-right:0px"&gt;&lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-left:0px;margin-right:0px"&gt;&lt;font face="arial, tahoma, verdana"&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;&amp;#26412;&amp;#21608;&amp;#30340;&amp;#38382;&amp;#39064;&amp;#65306;&lt;br&gt;1. &amp;#32473;&amp;#20320;&amp;#19968;&amp;#20010;high-resolution&amp;#30340;mesh, &amp;#30693;&amp;#36947;&amp;#23427;&amp;#26159;&amp;#20174;low-res mesh&amp;#32463;&amp;#36807;subd&amp;#20986;&amp;#26469;&amp;#30340;&amp;#65292;&amp;#24590;&amp;#20040;&amp;#21453;&amp;#27714;&amp;#22238;&amp;#21435;&amp;#21602;&amp;#65311;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-left:0px;margin-right:0px"&gt;&lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-left:0px;margin-right:0px"&gt;&lt;font face="arial, tahoma, verdana"&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;2. &amp;#20160;&amp;#20040; &amp;#26159;Principal Component Analysis&amp;#21602;&amp;#65311; &amp;#22312;&amp;#27714;Iso-charts (Kun Zhou2004)&amp;#20013;&amp;#29992;&amp;#21040;&amp;#20102;&amp;#65292;&amp;#32780;iso-charts&amp;#26159;Direct3D UV Atlas&amp;#20989;&amp;#25968;&amp;#30340;&amp;#21407;&amp;#29702;&amp;#12290;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-left:0px;margin-right:0px"&gt;&lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-left:0px;margin-right:0px"&gt;&lt;font face="arial, tahoma, verdana"&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;3. &amp;#19968;&amp;#20010;quad-mesh&amp;#19978;&amp;#21482;&amp;#29992;valence=3or4or5&amp;#30340;&amp;#39030;&amp;#28857;&amp;#26469;&amp;#34920;&amp;#31034;&amp;#21487;&amp;#20197;&amp;#21527;&amp;#65311;&amp;#22312;&amp;#30475;&amp;#20102;&amp;#19968;&amp;#20123;&amp;#27169;&amp;#22411;&amp;#20043;&amp;#21518;&amp;#65292;&amp;#35273;&amp;#24471;&amp;#22909;&amp;#20687;&amp;#22312;&amp;#24067;&amp;#32447;&amp;#26102;&amp;#20505;&amp;#29992;&amp;#36825;&amp;#19977;&amp;#31867;&amp;#39030;&amp;#28857;&amp;#23601;&amp;#22823;&amp;#33268;&amp;#22815;&amp;#29992;&amp;#20102;&amp;#12290;&amp;#21021;&amp;#22987;&amp;#30340;&amp;#24863;&amp;#35273;&amp;#26159;&amp;#65306;3.1 &amp;#35201;&amp;#20570;&amp;#19968;&amp;#20010;&amp;#35282;&amp;#30340;&amp;#26102;&amp;#20505;, &amp;#22312;&amp;#20363;&amp;#22914;&amp;#31435;&amp;#26041;&amp;#20307;&amp;#30340;&amp;#35282;&amp;#37027;&amp;#37324;&amp;#65292;&amp;#29992;valence=3&amp;#26469;&amp;#20998;&amp;#21106;&amp;#19977;&amp;#20010;&amp;#24179;&amp;#38754;. 3.2 &amp;#35201;&amp;#20570;&amp;#19968;&amp;#20010;&amp;#20984;&amp;#20986;&amp;#26469;&amp;#37096;&amp;#20998;&amp;#26102;&amp;#20505;, &amp;#29992;valence=5, &amp;#20854;&amp;#20013;&amp;#22235;&amp;#20010;&amp;#36793;&amp;#26159;&amp;#24179;&amp;#38754;&amp;#30340;&amp;#24418;&amp;#25104;&amp;#22522;&amp;#24231;&amp;#65292;&amp;#37027;&amp;#20010;&amp;#22810;&amp;#20986;&amp;#26469;&amp;#30340;&amp;#31532;&amp;#20116;&amp;#20010;&amp;#36793;&amp;#19978;&amp;#24448;&amp;#19978;&amp;#25289;&amp;#24448;&amp;#19978;&amp;#30003;&amp;#20986;&amp;#21435;&amp;#30340;, &amp;#36825;&amp;#31532;&amp;#20116;&amp;#20010;&amp;#36793;&amp;#21644;&amp;#23427;&amp;#24038;&amp;#21491;&amp;#38468;&amp;#36817;&amp;#30340;&amp;#20004;&amp;#20010;&amp;#36793;&amp;#23601;&amp;#24418;&amp;#25104;&amp;#20102;&amp;#37027;&amp;#20984;&amp;#20986;&amp;#21435;&amp;#37096;&amp;#20998;. 3.3 &amp;#20985;&amp;#36827;&amp;#21435;&amp;#30340;&amp;#37096;&amp;#20998;&amp;#31867;&amp;#20284;&amp;#65292;&amp;#31532;&amp;#20116;&amp;#20010;&amp;#36793;&amp;#26159;&amp;#24448;&amp;#24179;&amp;#38754;&amp;#20869;&amp;#37096;&amp;#30003;&amp;#30340;&amp;#12290;&amp;#32431;&amp;#29468;&amp;#27979;:-)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-179663993654897941?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/179663993654897941/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/04/2010-4-8.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/179663993654897941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/179663993654897941'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/04/2010-4-8.html' title='2010-4-8 有趣的-有问题的'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-675000218376542210</id><published>2010-03-31T11:04:00.001+08:00</published><updated>2010-03-31T11:04:57.449+08:00</updated><title type='text'>smart pointer 随想</title><content type='html'>&lt;span style="font-family: Arial, Tahoma, Verdana; color: rgb(51, 51, 51)"&gt;&lt;font size="2"&gt;我开始觉得无论是auto_ptr 以及 Reference Counting 其实都是保证只有一个pointer指向pointee/object, 这个object只有一个pointer拥有它的owership. 在auto_ptr中就很明显了, 而在RC中它封装好了这个唯一的pointer, 并通过override那些opertor* -&amp;gt;来让外界使用. 所以不要出现T *pointer = new T这定义, 而是该用Reference ref = new T;&lt;br&gt;另外, Reference ref本身是作为一个stack上的variable, 那就当然在离开当前scope时候自动释放资源.&lt;br&gt;RC的想法是：pointer这东西危险，归我保管，但是你们可以借用。&lt;br&gt;但是并不是什么用pointer的地方都需要用RC来代理, 例如一个Tree中很多Node的pointer，就不需要用RC来代理。为什么？(你想想RC的出发点就知道了:-)&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-675000218376542210?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/675000218376542210/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/03/smart-pointer.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/675000218376542210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/675000218376542210'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/03/smart-pointer.html' title='smart pointer 随想'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-8768950995912752572</id><published>2010-03-31T11:03:00.001+08:00</published><updated>2010-03-31T11:03:49.577+08:00</updated><title type='text'>问题-2010/3/31</title><content type='html'>&lt;font face="arial, tahoma, verdana"&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;std::vector&amp;lt;Position&amp;gt; arr; &amp;#20869;&amp;#21547;4&amp;#20010;&amp;#22352;&amp;#26631;&amp;#20803;&amp;#32032;.&lt;br&gt;&amp;#27714;&amp;#22235;&amp;#20010;&amp;#36793;v0-v1, v1-v2, v2-v3, v3-v0&amp;#36830;&amp;#36215;&amp;#26469;&amp;#30340;&amp;#26159;&amp;#19968;&amp;#20010;&amp;#22235;&amp;#36793;&amp;#24418;&amp;#65292;&amp;#20808;&amp;#19981;&amp;#32771;&amp;#34385;&amp;#20985;&amp;#20984;&amp;#65292;&amp;#20801;&amp;#35768;&amp;#38750;&amp;#20849;&amp;#38754;&amp;#12290;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;&lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-8768950995912752572?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/8768950995912752572/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/03/2010331.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8768950995912752572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8768950995912752572'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/03/2010331.html' title='问题-2010/3/31'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-2996589205238926849</id><published>2010-02-03T21:48:00.001+08:00</published><updated>2010-06-06T15:59:55.033+08:00</updated><title type='text'>SubD + Tessellator unit</title><content type='html'>&lt;br&gt;&lt;div&gt;1. subdivision surfaces(subD)&amp;#30340;&amp;#21364;&amp;#24050;&amp;#32463;&amp;#24456;&amp;#27969;&amp;#34892;&amp;#20102;, &amp;#20363;&amp;#22914;Maya, ZBrush, Modo&amp;#31561;&amp;#37117;&amp;#25903;&amp;#25345;&amp;#23545;&amp;#36825;&amp;#31867;&amp;#22411;&amp;#26354;&amp;#38754;&amp;#25805;&amp;#20316;&amp;#12290;&amp;#36825;&amp;#25805;&amp;#20316;&amp;#26242;&amp;#26102;&amp;#22810;&amp;#25968;&amp;#26159;&amp;#23616;&amp;#38480;&amp;#22312;high level&amp;#19978;&amp;#22686;&amp;#21152;details, &amp;#32780;&amp;#19981;&amp;#26159;&amp;#21160;&amp;#24577;&amp;#30340;&amp;#32534;&amp;#36753;base mesh&amp;#26469;&amp;#24471;&amp;#21040;&amp;#26032;&amp;#30340;&amp;#26354;&amp;#38754;&amp;#65292;&amp;#20026;&amp;#20160;&amp;#20040;&amp;#21602;&amp;#65311;&amp;#31532;&amp;#19968;&amp;#31181;&amp;#25805;&amp;#20316;&amp;#30340;base mesh, high level surface&amp;#26159;&amp;#27515;&amp;#30340;&amp;#27515;&amp;#22266;&amp;#23450;&amp;#30340;&amp;#65292;&amp;#32780;&amp;#21518;&amp;#32773;&amp;#31532;&amp;#20108;&amp;#31181;&amp;#25805;&amp;#20316;&amp;#20013;mesh&amp;#26159;&amp;#25913;&amp;#21464;&amp;#30340;&amp;#65292;&amp;#35201;&amp;#23454;&amp;#26102;&amp;#22320;&amp;#29983;&amp;#25104;&amp;#38754;&amp;#25968;&amp;#30446;&amp;#26356;&amp;#22810;&amp;#30340;high level&amp;#26159;&amp;#19981;&amp;#23481;&amp;#26131;&amp;#30340;&amp;#12290;&lt;/div&gt;&lt;div&gt;&amp;#31532;&amp;#19968;&amp;#31181;&amp;#25805;&amp;#20316;&amp;#65292;&amp;#19968;&amp;#33324;&amp;#26159;&amp;#22312;high level surface&amp;#22686;&amp;#21152;&amp;#32454;&amp;#33410;, &amp;#28982;&amp;#21518;&amp;#29983;&amp;#25104;normal/bump/displacement map&amp;#65292;&amp;#36830;&amp;#24102;base mesh&amp;#19968;&amp;#36215;&amp;#36755;&amp;#20986;&amp;#12290;&amp;#22312;&amp;#21518;&amp;#32493;&amp;#30340;&amp;#28210;&amp;#26579;&amp;#20013;&amp;#65292;&amp;#21482;&amp;#35201;&amp;#23558;&amp;#36825;&amp;#20123;map bake&amp;#21040;base mesh&amp;#23601;&amp;#21487;&amp;#20197;&amp;#20102;.&amp;nbsp;&lt;/div&gt;&lt;br&gt;&lt;div&gt;2. &amp;#34429;&amp;#28982;subD&amp;#36825;&amp;#20040;prevalence&amp;#20102;, &amp;#20294;&amp;#26159;&amp;#22312;&amp;#28216;&amp;#25103;&amp;#31561;&amp;#23454;&amp;#26102;&amp;#24212;&amp;#29992;&amp;#31243;&amp;#24207;&amp;#20013;&amp;#36824;&amp;#26159;&amp;#20197;&amp;#19977;&amp;#35282;&amp;#29255;&amp;#32452;&amp;#25104;&amp;#30340;mesh&amp;#20026;&amp;#20027;&amp;#65292;&amp;#20027;&amp;#35201;&amp;#21407;&amp;#22240;&amp;#26159;&amp;#20160;&amp;#20040;&amp;#65311;&amp;#20854;&amp;#19968;&amp;#26159;&amp;#24213;&amp;#23618;&amp;#30340;&amp;#30828;&amp;#20214;&amp;#20027;&amp;#35201;&amp;#23545;&amp;#19977;&amp;#35282;&amp;#29255;&amp;#28210;&amp;#26579;&amp;#20570;&amp;#20102;&amp;#20248;&amp;#21270;. &amp;#25152;&amp;#20197;&amp;#19981;&amp;#31649;&amp;#20320;&amp;#19978;&amp;#23618;&amp;#29992;&amp;#20160;&amp;#20040;&amp;#34920;&amp;#31034;&amp;#26041;&amp;#24335;&amp;#65292;&amp;#26368;&amp;#21518;&amp;#36824;&amp;#26159;&amp;#24471;&amp;#25442;&amp;#25104;&amp;#19977;&amp;#35282;&amp;#29255;&amp;#26469;&amp;#21270;&amp;#65292;&amp;#65288;&amp;#20063;&amp;#26159;&amp;#20986;&amp;#20110;&amp;#36825;&amp;#20010;&amp;#21407;&amp;#22240;&amp;#65292;&amp;#25105;&amp;#35273;&amp;#24471;point cloud&amp;#20063;&amp;#26159;, &amp;#26368;&amp;#21518;&amp;#36824;&amp;#26159;&amp;#19977;&amp;#35282;&amp;#21078;&amp;#20998;&amp;#28982;&amp;#21518;&amp;#20877;&amp;#28210;&amp;#26579;&amp;#20986;&amp;#26469;&amp;#65289;&amp;#12290;Direct3D 11 &amp;#20013;&amp;#21152;&amp;#20837;&amp;#21040;tessellator unit&amp;#22909;&amp;#22788;&amp;#23601;&amp;#26159;&amp;#21487;&amp;#20197;&amp;#22312;GPU&amp;#19978;&amp;#21160;&amp;#24577;&amp;#22320;&amp;#29983;&amp;#25104;high level mesh(base mesh&amp;#36824;&amp;#26159;&amp;#22312;CPU&amp;#19978;)&amp;#65292;&amp;#32780;&amp;#19981;&amp;#38656;&amp;#35201;&amp;#22312;CPU&amp;#20013;&amp;#20570;&amp;#22909;&amp;#20960;&amp;#27425;subd&amp;#24471;&amp;#21040;&amp;#24456;&amp;#23494;&amp;#30340;high level&amp;#28982;&amp;#21518;&amp;#20877;&amp;#25918;&amp;#21040;GPU&amp;#19978;&amp;#28210;&amp;#26579;&amp;#12290;&amp;#20294;&amp;#36825;&amp;#37324;&amp;#26377;&amp;#19968;&amp;#20010;&amp;#20851;&amp;#38190;&amp;#28857;&amp;#31639;&amp;#27861;&amp;#65292;&amp;#23601;&amp;#26159;high level surface(&amp;#20854;&amp;#23454;&amp;#24212;&amp;#35813;&amp;#35828;&amp;#25104;&amp;#26159;limit surface)&amp;#30340;&amp;#21442;&amp;#25968;&amp;#34920;&amp;#31034;, &amp;#22240;&amp;#20026;tessellator unit&amp;#20013;&amp;#30340;Hull shader&amp;#38656;&amp;#35201;&amp;#26681;&amp;#25454;base mesh&amp;#29983;&amp;#25104;limit surface&amp;#19978;&amp;#27599;&amp;#19968;&amp;#20010;patch(&amp;#26354;&amp;#38754;&amp;#29255;)&amp;#30340;&amp;#21442;&amp;#25968;&amp;#34920;&amp;#31034;, &amp;#20363;&amp;#22914;&amp;#22914;&amp;#26524;&amp;#40664;&amp;#35748;&amp;#26159;cubic bezier patch&amp;#65292;&amp;#37027;&amp;#20040;&amp;#21482;&amp;#35201;&amp;#35745;&amp;#31639;&amp;#20986;&amp;#36825;&amp;#20010;patch&amp;#30340;&amp;#25511;&amp;#21046;&amp;#28857;&amp;#23601;ok&amp;#20102;. (&amp;#24590;&amp;#20040;&amp;#35745;&amp;#31639;&amp;#21602;&amp;#65311;&amp;#21518;&amp;#38754;&amp;#25552;&amp;#21040;)&amp;#12290;&amp;#24471;&amp;#21040;&amp;#36825;&amp;#20123;&amp;#25511;&amp;#21046;&amp;#28857;&amp;#20043;&amp;#21518;&amp;#65292;&amp;#25105;&amp;#20204;&amp;#31561;&amp;#20110;&amp;#24471;&amp;#21040;&amp;#20102;&amp;#36825;&amp;#20010;patch&amp;#30340;&amp;#25968;&amp;#23398;&amp;#34920;&amp;#31034;(Hardware tessellation&amp;#26102;&amp;#20505;&amp;#40664;&amp;#35748;&amp;#26159;&amp;#29992;cubic bezier patch, 14&amp;#20010;&amp;#25511;&amp;#21046;&amp;#28857;&amp;#23450;&amp;#20102;, &amp;#29305;&amp;#23450;&amp;#23558;&amp;#36825;&amp;#20010;&amp;#25968;&amp;#23398;&amp;#34920;&amp;#36798;&amp;#24335;&amp;#37117;&amp;#21578;&amp;#35785;&amp;#20102;GPU), &amp;#20026;&amp;#20102;&amp;#35201;&amp;#28210;&amp;#26579;&amp;#20986;&amp;#26469;&amp;#65292;&amp;#36824;&amp;#26159;&amp;#22238;&amp;#21040;&amp;#35201;&amp;#20808;&amp;#20570;&amp;#19977;&amp;#35282;&amp;#21270;&amp;#22043;&amp;#12290;&amp;#20110;&amp;#26159;&amp;#23601;&amp;#26377;&amp;#20102;&amp;#21518;&amp;#38754;&amp;#30340;Tessellator&amp;#21644;Domain Shader, &amp;#22797;&amp;#26434;&amp;#37319;&amp;#26679;&amp;#21644;&amp;#28155;&amp;#21152;&amp;#26032;&amp;#30340;&amp;#39030;&amp;#28857;.&amp;nbsp;&lt;/div&gt;&lt;br&gt;3. &amp;#19978;&amp;#38754;&amp;#30340;&amp;#38382;&amp;#39064;&amp;#65306;&amp;#36825;&amp;#20040;&amp;#35745;&amp;#31639;&amp;#20986;patch&amp;#30340;&amp;#25511;&amp;#21046;&amp;#28857;&amp;#21602;&amp;#65311;&amp;#20027;&amp;#35201;&amp;#22320;&amp;#35831;&amp;#21442;&amp;#32771;:&lt;br&gt;&lt;div&gt;[C. Loop, S. Schaefer. Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches, Siggraphic 2008, the so called ACC]&lt;/div&gt;&lt;div&gt;[C. Loop, S. Schaefer, T. Ni, I. Castano. Approximating Subdivision Surfaces with Gregory Patches for Hardware Tessellation. &amp;nbsp;Siggraphic Asia 2009]&lt;/div&gt;&lt;br&gt;&lt;div&gt;4. &amp;#25105;&amp;#29616;&amp;#22312;&amp;#30340;&amp;#29702;&amp;#35299;&amp;#21644;&amp;#20195;&amp;#30721;&amp;#23454;&amp;#29616;&amp;#36824;&amp;#20572;&amp;#30041;&amp;#22312;mesh geometry&amp;#30340;&amp;#35282;&amp;#24230;&amp;#65292;&amp;#36824;&amp;#27809;&amp;#26377;&amp;#23545;&amp;#21152;&amp;#19978;displacement map&amp;#20043;&amp;#21518;&amp;#20250;&amp;#20135;&amp;#29983;texture seams&amp;#26377;&amp;#26356;&amp;#28145;&amp;#30340;&amp;#29702;&amp;#35299;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;[AMD. GPU Tessellation for Detailed, Animated Crowds]&amp;nbsp;&lt;/div&gt;&lt;div&gt;[PTex] &amp;#36825;&amp;#20004;&amp;#20010;&amp;#25991;&amp;#31456;&amp;#20013;&amp;#37117;&amp;#25552;&amp;#21040;&amp;#20102;filtering.&amp;nbsp;&lt;/div&gt;&lt;br&gt;&lt;div&gt;2010-2-2.&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div&gt;base mesh --&amp;gt; CPU subd&amp;nbsp;&amp;nbsp; --&amp;gt; hight level mesh --&amp;gt; limit mesh &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;gt; vertex buffer / index buffer.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&amp;gt; CPU calculate the control points for ACC patches, --&amp;gt; Tessellation on CPU &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&amp;gt; vertex buffer / index buffer.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&amp;gt; CPU calculate the control points for ACC patches, --&amp;gt; Tessellation on GPU using bindable uniform buffer(SDK 10) .&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font style="background-color:#00ff00"&gt; --&amp;gt; Hull shader &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --&amp;gt; Tessellator + Domain Shader &lt;/font&gt;--&amp;gt; render.&lt;/div&gt;&lt;div&gt;2010-02-03.&lt;/div&gt;&lt;br&gt;&lt;br&gt;[2010/6/6 updated]&amp;nbsp;&lt;div&gt;What is tessellation?&amp;nbsp;&lt;div&gt;&amp;#22312;[Real-time Rendering, 3rd]&amp;#20070;&amp;#20013;&amp;#30340;&amp;#23450;&amp;#20041;&amp;#27604;&amp;#36739;&amp;#28165;&amp;#26224;&amp;#65292;&amp;#35760;&amp;#24405;&amp;#19968;&amp;#19979;:&amp;quot;To display a curved surface in a real-time rendering context, we usually need to create a triangle mesh representation of the surface. This process is known as tessellation. The simplest form of tessellation is called uniform tessellation.&amp;quot; &amp;#20107;&amp;#23454;&amp;#19978;&amp;#36825;&amp;#20070;&amp;#22312;&amp;#36825;&amp;#26041;&amp;#38754;&amp;#20063;&amp;#35762;&amp;#24471;&amp;#30456;&amp;#24403;&amp;#35814;&amp;#32454;.&lt;/div&gt;&lt;br&gt;&lt;div&gt;What is hardware tessellation?&lt;/div&gt;&lt;div&gt;&amp;#22312;[Real-time Rendering, 3rd]&amp;#20070;&amp;#20013;&amp;#30340;&amp;#35828;&amp;#27861;&amp;#65292;&amp;#35760;&amp;#24405;&amp;#19968;&amp;#19979;: &amp;quot;An efficient way of providing inexpensive data expansion of geometry is to send higher-order surfaces to the GPU and let it tessellate the surface.&amp;quot;&amp;nbsp;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;&amp;#19979;&amp;#38754;&amp;#26469;&amp;#30475;&amp;#30475;tessellation factor&amp;#30340;&amp;#27010;&amp;#24565;.&lt;/div&gt;&lt;div id="x-7e" style="text-align:left"&gt;&lt;img src="http://docs.google.com/File?id=dfbh3m57_364cvwr67fm_b" style="height:161.562556px;width:648px"&gt;&lt;/div&gt;1. &amp;#32454;&amp;#20998;level&amp;#27599;&amp;#19968;&amp;#22686;&amp;#21152;&amp;#19968;&amp;#27493;, &amp;#37117;&amp;#20250;&amp;#22686;&amp;#21152;4&amp;#20493;&amp;#30340;&amp;#19977;&amp;#35282;&amp;#24418;&amp;#25968;&amp;#30446;, &amp;#25152;&amp;#20197;tessellation factor&amp;#23601;&amp;#27809;&amp;#26377;&amp;#24517;&amp;#35201;&amp;#36319;&amp;#36825;&amp;#20010;subD level&amp;#19968;&amp;#33268;.&lt;div&gt;2. &amp;#32454;&amp;#20998;level&amp;#23545;&amp;#24212;&amp;#27599;&amp;#19968;&amp;#20010;&amp;#36793;&amp;#37117;&amp;#26159;&amp;#19968;&amp;#26679;&amp;#30340;, &amp;#19981;&amp;#21033;&amp;#20110;LOD&amp;#20013;adjacent patch&amp;#30340;&amp;#36807;&amp;#28193;&amp;#38142;&amp;#25509;, &amp;#20110;&amp;#26159;&amp;#26377;&amp;#20102;&amp;#20687;&amp;#31532;&amp;#19977;&amp;#20010;&amp;#22270;&amp;#37027;&amp;#26679;&amp;#30340;tessellation&amp;#26041;&amp;#27861;, &amp;#24182;&amp;#19988;&amp;#19977;&amp;#20010;&amp;#36793;&amp;#21487;&amp;#20197;&amp;#26377;&amp;#19977;&amp;#20010;&amp;#19981;&amp;#21516;&amp;#30340;tessellation factor. &amp;#22312;Direct3D 11&amp;#20013;&amp;#26159;&amp;#30001;hull shader&amp;#35745;&amp;#31639;&amp;#20986;&amp;#26469;&amp;#30340;, &amp;#21478;&amp;#19968;&amp;#20010;hull shader&amp;#38656;&amp;#35201;&amp;#35745;&amp;#31639;&amp;#30340;&amp;#24403;&amp;#28982;&amp;#23601;&amp;#26159;control points&amp;#20102;.&lt;/div&gt;&lt;br&gt;&lt;div&gt;References:&lt;br&gt;Moreton H., Wateright Tessellation using Forward Differencing. In Graphics Hardware 2011. &amp;#25552;&amp;#20986;&amp;#20102;fractional tessellation&amp;#27010;&amp;#24565;.&lt;/div&gt;&lt;a href="http://developer.amd.com/gpu_assets/Real-Time_Tessellation_on_GPU.pdf" id="wuhk" title="http://developer.amd.com/gpu_assets/Real-Time_Tessellation_on_GPU.pdf"&gt;http://developer.amd.com/gpu_assets/Real-Time_Tessellation_on_GPU.pdf&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;a href="http://developer.amd.com/gpu_assets/Direct3D%2011%20Tessellation%20Tutorial.ppsx" target="_blank" title="Link opens in new window."&gt;Direct3D 11 Tessellation Tutorial&lt;/a&gt;: Bill Bilodeau&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-2996589205238926849?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/2996589205238926849/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2010/02/subd-tessellator-unit.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2996589205238926849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2996589205238926849'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2010/02/subd-tessellator-unit.html' title='SubD + Tessellator unit'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-656575447218403494</id><published>2009-07-10T17:18:00.002+08:00</published><updated>2009-07-10T17:34:03.515+08:00</updated><title type='text'>why to learn OpenGL?</title><content type='html'>有点无聊，于是打开了之前收藏的关于opengl tutorials的链接。既然是tutorial嘛，当然很多都是初步介绍怎么使用api等一些基础，于是有点烦。&lt;br /&gt;&lt;br /&gt;就想，为什么要学OpenGL呢？&lt;br /&gt;1. 通过学OpenGL来了解Graphics/Rendering Pipeline.&lt;br /&gt;例如在看Essential Mathematics for Grames and Interactive Application时候，那些Transformation, lighting, framebufffer等概念以及计算方式，&lt;br /&gt;要是结合OpenGL的Api，那些原理对应什么api，能达到什么效果，这感觉多好啊。&lt;br /&gt;例如在3D Game Engine Design, second edition时候，那个software render engine，要是结合原理一起看，那估计就深刻了。&lt;br /&gt;&lt;br /&gt;2. OpenGL是基础招式，例如C/C++的语法掌握，在此基础上可以去学习很多更复杂的算法、框架和系统等。&lt;br /&gt;例如&lt;a href="http://www.paulsprojects.net/opengl/projects1.html"&gt;http://www.paulsprojects.net/opengl/projects1.html&lt;/a&gt;这上面就很多特效算法，当然不是为了某几个特别的例子啦，&lt;br /&gt;我估计从它们中可以了解到一类的特效，甚至做一个特效系统，然后特效算法估计也涉及其它更广阔的知识面。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-656575447218403494?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/656575447218403494/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/07/why-to-learn-opengl.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/656575447218403494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/656575447218403494'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/07/why-to-learn-opengl.html' title='why to learn OpenGL?'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-2678510483621610772</id><published>2009-07-10T14:31:00.005+08:00</published><updated>2009-07-10T14:36:44.624+08:00</updated><title type='text'>glext; glew, glee这些library的原理</title><content type='html'>下面就是glext为我们做的事：&lt;br /&gt;(1), 根据显卡厂商对某个extension的具体说明来定义一些宏.&lt;br /&gt;#define GL_ARRAY_BUFFER_ARB 0x8892 //具体的地址是在各个specification中定义的.&lt;br /&gt;#define GL_STATIC_DRAW_ARB 0x88E4&lt;br /&gt;&lt;br /&gt;(2), 声明一些函数指针的类型.&lt;br /&gt;typedef void (APIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);&lt;br /&gt;typedef void (APIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);&lt;br /&gt;typedef void (APIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);&lt;br /&gt;typedef void (APIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, int size, const GLvoid *data, GLenum usage);&lt;br /&gt;&lt;br /&gt;然后在我自己的实现中就需要做以下的事:&lt;br /&gt;(3). 声明定义一些函数指针:&lt;br /&gt;PFNGLGENBUFFERSARBPROC glGenBuffersARB = NULL;&lt;br /&gt;PFNGLBINDBUFFERARBPROC glBindBufferARB = NULL;&lt;br /&gt;PFNGLBUFFERDATAARBPROC glBufferDataARB = NULL;&lt;br /&gt;PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB = NULL;&lt;br /&gt;&lt;br /&gt;(4). 利用wglGetProcAddress函数取得各个函数的地址指针.&lt;br /&gt;glBindBufferARB = (PFNGLBINDBUFFERARBPROC)wglGetProcAddress("glBindBufferARB");&lt;br /&gt;glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)wglGetProcAddress("glGenBuffersARB");&lt;br /&gt;glBufferDataARB = (PFNGLBUFFERDATAARBPROC)wglGetProcAddress("glBufferDataARB");&lt;br /&gt;而其实在glATI.h, wglATI.h, ATIExtensions.h, and ATIExtensions.c中也是这么做的.&lt;br /&gt;&lt;br /&gt;那些glew, glee就将上面4步都给我们做了.&lt;br /&gt;&lt;br /&gt;所以当使用extensions时候，&lt;br /&gt;要么是下载glext回来，自己提供源代码实现(3, 4)两步.&lt;br /&gt;要么是直接用glew or glee.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-2678510483621610772?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/2678510483621610772/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/07/glext-glew-gleelibrary.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2678510483621610772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2678510483621610772'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/07/glext-glew-gleelibrary.html' title='glext; glew, glee这些library的原理'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-6245291695527340112</id><published>2009-07-09T22:18:00.003+08:00</published><updated>2009-07-09T22:28:11.294+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='extensions'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='opengl32.dll'/><category scheme='http://www.blogger.com/atom/ns#' term='OpenGL'/><title type='text'>opengl32.dll--Windows系统下OpenGL的实现和扩展</title><content type='html'>&lt;a href="http://www.gamedev.net/community/forums/mod/journal/journal.asp?jn=433428&amp;amp;reply_id=3229111"&gt;Windows, OpenGL Versions, and Extensions&lt;/a&gt;&lt;br /&gt;这是在&lt;a href="http://www.gamedev.net/"&gt;http://www.gamedev.net/&lt;/a&gt; 上看到的文章, 这里转帖一下:&lt;br /&gt;Something I've noticed any number of times is that many people are quite vague on how OpenGL works on Windows. This causes a lot of confusion about exactly what the limitations on Windows are with respect to versions, and people tend to say things that don't make sense. The most common misunderstanding is that Windows is limited to OpenGL 1.1. It's time to clear things up.&lt;br /&gt;  First, let's start by dissecting the &lt;strong&gt;&lt;span style="color:#990000;"&gt;basic OpenGL architecture on Windows&lt;/span&gt;&lt;/strong&gt;. When you build your OpenGL based program, you link to &lt;strong&gt;&lt;em&gt;opengl32.lib&lt;/em&gt;&lt;/strong&gt;. This file from the Platform SDK is a companion to the &lt;strong&gt;&lt;em&gt;opengl32.dll&lt;/em&gt;&lt;/strong&gt; that ships with Windows. The &lt;strong&gt;&lt;em&gt;GL/gl.h&lt;/em&gt;&lt;/strong&gt; header you use matches these two files. When your code runs, some behind the scenes work happens that loads up the functions out of opengl32.dll. However, opengl32.dll is &lt;span style="color:#990000;"&gt;a &lt;strong&gt;purely software implementation of OpenGL 1.1&lt;/strong&gt;&lt;/span&gt;, and it's probably not what you want to be using. What you want to be using is the real OpenGL DLL, for example nvoglnt.dll. This file is installed with your &lt;span style="color:#006600;"&gt;&lt;strong&gt;video driver&lt;/strong&gt;&lt;/span&gt;.&lt;br /&gt;  This is where magic starts to happen. Your calls to opengl32.dll will be redirected to the actual driver specific DLL, which exports at least all the functions in opengl32.dll. The trick is, it also exports a lot more than that. The entire OpenGL API for the version that it supports will be exported, along with all the extensions. Calls to &lt;strong&gt;&lt;span style="color:#000099;"&gt;wglGetProcAddress&lt;/span&gt;&lt;/strong&gt; become GetProcAddress calls on the OpenGL DLL that came from the driver. This isn't limited to extensions; you can use it on regular non-extension functions as long as the video driver supports a version of OpenGL that includes them.&lt;br /&gt;  The problem here is that, depending on the manufacturer of your video driver and the version, the real DLL that implements OpenGL could be anywhere. Windows provides opengl32.dll as a common place to go to, instead of having to figure out what DLL you need at runtime. That DLL also servves the dual purpose of providing the basic software implementation. That's why it's nearly never been updated; adding new OpenGL functions would mean writing code to implement all of that in software. In Vista they decided to provide a new version built on D3D instead of software, so applications using the Vista headers and libraries can get a baseline of OpenGL 1.4 statically.&lt;br /&gt;All that an extension loader does, then, is to automate the tedious process of making the dozens or hundreds of GetProcAddress calls to retrieve the functions that aren't statically linked and forwarded. Again, these functions don't have to be extensions. You can wglGetProcAddress for glMapBuffer, not just glMapBufferARB. There's no question of what Windows supports. &lt;em&gt;&lt;span style="color:#990000;"&gt;It doesn't matter. The only function you actually need from Windows is wglGetProcAddress, which is your key to accessing the real OpenGL DLL.&lt;/span&gt;&lt;/em&gt; The rest of the interface is just a convenience in that you don't have to go out and get the addresses for the OpenGL 1.1 functions, since they're already being redirected for you. And since modern extension loaders are machine generated systems that automatically look up everything, it's less relevant than ever before.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-6245291695527340112?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/6245291695527340112/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/07/opengl32dll-windowsopengl.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/6245291695527340112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/6245291695527340112'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/07/opengl32dll-windowsopengl.html' title='opengl32.dll--Windows系统下OpenGL的实现和扩展'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-2343559150541002295</id><published>2009-07-08T20:24:00.005+08:00</published><updated>2009-07-12T19:17:14.612+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='memory'/><category scheme='http://www.blogger.com/atom/ns#' term='reading notes'/><category scheme='http://www.blogger.com/atom/ns#' term='pointer'/><title type='text'>Reading note - memory management</title><content type='html'>book1: Memory as a Programming concept in c and c++ 已经打印了.&lt;br /&gt;book2: c++ pointers and dynamic menory management. Michael C. Daconta.&lt;br /&gt;&lt;br /&gt;Memory location: a container that can store a binary number.&lt;br /&gt;Address: a unique binary number assigned to every memory location. 特别的二进制数。&lt;br /&gt;Pointer: a memory location that stores an address&lt;br /&gt;Variable:a named memory location that can store a value of certain data type..[book2 chapter2]&lt;br /&gt;&lt;br /&gt;There is absolutely no difference in functionality between pointers and references. The difference is that with references, the compiler handles the details of passing pointers and dereferencing them instead of you doing it yourself.&lt;br /&gt;1. A reference is an alias for a variable, is not an object, while a pointer is an object. An object has two main attributes: its storage class and its type. The storage class determines the lifetime of this chunk of storage, while the type determines the meaning of values found in the object.&lt;br /&gt;2. References exist only in the compiler and not after compilation. They have symbol table entries only.&lt;br /&gt;3. 初始化时候要给出初值，除了在class中是在初始化列表中的，不能做数学操作.&lt;br /&gt;&lt;br /&gt;Array name, is a label, the label of the first address, is not the same as a pointer.&lt;br /&gt;&lt;br /&gt;Three memory spaces: [book1,2]&lt;br /&gt;1. global: for global variables(函数之外没有被static关键字的, 函数之内有static关键字的，类声明中static的variables), allocated at compile.&lt;br /&gt;2. stack: activation frame when a function is called, the local automatic variables.&lt;br /&gt;3. free store: binary heap(system heap or free store) at os level keeped by os memory management, dynamic list of free segments at process level keeped by process memory manager.[book1 chapter4].&lt;br /&gt;&lt;br /&gt;malloc/new.&lt;br /&gt;malloc 自己用sizeof觉得分配的字节数，返回的是void*，分配得到的空间之内是垃圾数据；&lt;br /&gt;而new在这三方面都有所不同。&lt;br /&gt;&lt;br /&gt;Pass by value: cope the variable's &lt;span style="color:#006600;"&gt;content&lt;/span&gt; to the activation frame(function stack).&lt;br /&gt;Pass by reference: cope the variable's &lt;span style="color:#cc0000;"&gt;address&lt;/span&gt; to the activation frame.&lt;br /&gt;&lt;br /&gt;在datastructure中找&lt;a href="http://cslibrary.stanford.edu/103/"&gt;linklist的笔记&lt;/a&gt;, 也涉及pointer的使用, &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;学会画图来表示, 32bit里面是variable的地址呢，还是pointer的地址呢?这就是一级pointer和二级pointer的区别&lt;/span&gt;&lt;/strong&gt;。&lt;br /&gt;特别是那个push(struct node *head, int data)的为什么错了, 而需要改成push(struct node **head, int data)?&lt;br /&gt;一定要学着画图, 并且结合以下的概念，&lt;br /&gt;函数传递struct node，那么是将整个structure copy一份到被调用函数的activation frame;&lt;br /&gt;如果函数传递的是struct node*，那么是将structure的地址，也就是指针本身的context copy一份到被调用函数的activation frame;&lt;br /&gt;如果函数传递的是struct node**，那么是将指针本身的address copy一份到被调用函数的activation frame, 这样就修改到指针本身了.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-2343559150541002295?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/2343559150541002295/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/07/reading-note-memory-management.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2343559150541002295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2343559150541002295'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/07/reading-note-memory-management.html' title='Reading note - memory management'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1155834398201236026</id><published>2009-07-08T09:33:00.005+08:00</published><updated>2009-07-08T20:19:01.300+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='intel'/><category scheme='http://www.blogger.com/atom/ns#' term='company'/><title type='text'>intel relative</title><content type='html'>&lt;a href="http://software.intel.com/zh-cn/"&gt;英特尔® 软件网络&lt;/a&gt; 那个blog的页面上看出来intel的确是在做multi-core的，相对于nvidia的GPGPU.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1155834398201236026?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1155834398201236026/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/07/intel-relative.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1155834398201236026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1155834398201236026'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/07/intel-relative.html' title='intel relative'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1847082290325091666</id><published>2009-06-19T10:11:00.001+08:00</published><updated>2009-07-09T11:12:28.341+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='宗教'/><category scheme='http://www.blogger.com/atom/ns#' term='哲学'/><title type='text'>哲学 宗教</title><content type='html'>&lt;a href="http://www.lib.hstc.edu.cn/dzsk/zxzj/ZXZJ.htm"&gt;http://www.lib.hstc.edu.cn/dzsk/zxzj/ZXZJ.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1847082290325091666?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1847082290325091666/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/06/httpwww.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1847082290325091666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1847082290325091666'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/06/httpwww.html' title='哲学 宗教'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-5921153808409647798</id><published>2009-06-16T13:44:00.011+08:00</published><updated>2009-07-08T20:24:23.881+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='c'/><category scheme='http://www.blogger.com/atom/ns#' term='memory'/><title type='text'>memory management in c/c++, resources</title><content type='html'>1. book, Memory as a Programming Concept in C and C++. &lt;div&gt;2. book, 程序员的自我修养—链接、装载与库, 第10 章 内存.&lt;/div&gt;&lt;div&gt;3.&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;font-family:verdana;" class="Apple-style-span" &gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;C++ Memory Management: From Fear to Triumph, 3parts.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.linuxdevcenter.com/pub/a/linux/2003/05/08/cpp_mm-1.html?page=1"&gt;http://www.linuxdevcenter.com/pub/a/linux/2003/05/08/cpp_mm-1.html?page=1&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.linuxdevcenter.com/pub/a/linux/2003/06/19/cpp_mm-1.html"&gt;http://www.linuxdevcenter.com/pub/a/linux/2003/06/19/cpp_mm-1.html&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://www.linuxdevcenter.com/pub/a/linux/2003/08/07/cpp_mm-3.html#twc"&gt;http://www.linuxdevcenter.com/pub/a/linux/2003/08/07/cpp_mm-3.html#twc&lt;/a&gt;&lt;/div&gt;&lt;div&gt;4. &lt;span class="Apple-style-span"  style="font-family:'Lucida Grande';"&gt;&lt;a href="http://www.informit.com/articles/article.aspx?p=30642"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;C++ Memory and Resource Management&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;5. &lt;a href="http://www.ibm.com/developerworks/cn/linux/l-memory/"&gt;内存管理内幕&lt;/a&gt;. &lt;/div&gt;&lt;div&gt;&lt;a href="http://oiramario.cnblogs.com/archive/2006/01/10/314354.html"&gt;http://oiramario.cnblogs.com/archive/2006/01/10/314354.html&lt;/a&gt; 整理了很多资料&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;http://www.gowrikumar.com/c/ &lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;http://wangcong.org/blog/?p=291 西邮 &lt;a href="http://www.redhat.com/"&gt;Redhat&lt;/a&gt; Beijing&lt;/div&gt;&lt;div&gt;http://www.matrix67.com/blog/archives/429 重庆的 顾森88年, 这天才好像读北大中文系（2007.9开始），PKU的ACM貌似对他没难度，估计也是高中就天才那种，信息学奥赛，http://www.matrix67.com/blog/archives/319&lt;br /&gt;http://cuitianyi.com 89年高中就acm获奖数学天才，保送ZJU的CS，貌似他们跟楼天成是类似的人物，高手都是在初高中就很出名了，。基础数学-&gt; CS. http://cuitianyi.com/blog/category/life/page/5/，http://cuitianyi.com/blog/%e5%9c%a8%e9%83%91%e5%b7%9e/， : 离散数学，组合数学，数学分析...文理都优秀，在他们的圈子里面很活跃，但估计也有疑惑的时候。：大量，很大量的阅读经典的文史著作和数学著作，算法，编程。：距离一般人有点远，甚至例如家庭条件等就不允许，但是只是程度和轨迹不一样的啦，阅读文史，算法编程还是可以和应该做的。&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-5921153808409647798?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/5921153808409647798/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/06/memory-management-in-cc.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5921153808409647798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5921153808409647798'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/06/memory-management-in-cc.html' title='memory management in c/c++, resources'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3129882724981014867</id><published>2009-06-12T17:00:00.001+08:00</published><updated>2009-06-12T17:02:35.859+08:00</updated><title type='text'>Apply Game Design as a Science?</title><content type='html'>&lt;p&gt;&lt;a href="http://alum.mit.edu/news/WhatMatters/Archive/200904/index.jsp"&gt;Apply Game Design as a Science for Public Policy to Rescue Economy, Planet.&lt;/a&gt; &lt;/p&gt;&lt;p&gt;By Morgan McGuire, Assistant Professor &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3129882724981014867?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3129882724981014867/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/06/apply-game-design-as-science.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3129882724981014867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3129882724981014867'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/06/apply-game-design-as-science.html' title='Apply Game Design as a Science?'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1873691008368494982</id><published>2009-04-25T13:15:00.002+08:00</published><updated>2009-04-25T13:20:13.815+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gui'/><title type='text'>Nvidia widgets (gui)</title><content type='html'>目录结构:&lt;br /&gt;&lt;br /&gt;extern/glew&lt;br /&gt;            /glut&lt;br /&gt;&lt;br /&gt;src/nvglutils/nvShaderUtils.h // dependent on glew&lt;br /&gt;     /nvwidgets/nvGlutWidgets.cpp, nvGlutWidgets.h // dependent on glut &lt;br /&gt;     /nvwidgets/nvGLWidgets.cpp, nvGLWidgets.h // dependent on opengl  &lt;br /&gt;     /nvwidgets/nvWidgets.cpp, nvWidgets.h&lt;br /&gt;     /examples/example.cpp&lt;br /&gt;&lt;br /&gt;类结构:&lt;br /&gt;nvWidgets.h, class UIPainter and class UIContext.&lt;br /&gt;&lt;br /&gt;GLWidgets.h, class GLUIPainter: public UIPainter {&lt;br /&gt;                           //implement all the virtual functions of the base class,&lt;br /&gt;                           //to draw ui elements with OpenGL.&lt;br /&gt;                           GLUIPainter();&lt;br /&gt;                           begin(const Rect &amp;amp;window);&lt;br /&gt;                           end();&lt;br /&gt;                           drawXXXX(...);&lt;br /&gt;                           ...&lt;br /&gt;                           init();//compile and like shaders. invoked by begin(...) function.&lt;br /&gt;                         };&lt;br /&gt;&lt;br /&gt;                         class UIContext {&lt;br /&gt;                           //This class is ready for use, but use the GlutUIContext as adaptor.&lt;br /&gt;                           UIContext( UIPainter&amp;amp; painter ); // use painter(GLUIPainter) to draw UI.&lt;br /&gt;                           reshape(int w, int h);&lt;br /&gt;                           isOnFocus();&lt;br /&gt;                           mouse(int button, int state, ...);&lt;br /&gt;                           keyboard(unsigned char k, int x, int y);&lt;br /&gt;&lt;br /&gt;                           begin(); //m_painter-&gt;begin(m_window);&lt;br /&gt;                           end(); //m_painter-&gt;end();&lt;br /&gt;                           doLabel(...);// use the painter to drawLabel;&lt;br /&gt;                           doButton(...);// use the painter to drawButton;&lt;br /&gt;                           ...&lt;br /&gt;&lt;br /&gt;                           UIPainter *m_painter;&lt;br /&gt;                           Rect m_window;&lt;br /&gt;                           Point m_currentCursor;&lt;br /&gt;                           ButtonState m_mouseButton[3];&lt;br /&gt;                           unsigned char m_keyBuffer[32];&lt;br /&gt;                           ....&lt;br /&gt;                         };&lt;br /&gt;&lt;br /&gt;GlutWidgets.h, class GlutUIContext: public UIContext {&lt;br /&gt;                           // As an adaptor for GLUT,&lt;br /&gt;                           GlutUIContext():UIContext(*(new GLUIPainter())), m_ownPainter(true) {}&lt;br /&gt;                           GlutUIContext(UIPainter &amp;amp;painter):UIContext(painter), m_ownPainter(false) {}&lt;br /&gt;                           init(); // invoke glewInit();&lt;br /&gt;                           mouse(int button, int state, int x, int y); //translate the Glut mouse to nvWidgets mouse.&lt;br /&gt;                           specialKeyboard(int k, int x, int y);&lt;br /&gt;                         };&lt;br /&gt;&lt;br /&gt;小结:&lt;br /&gt;(1)一个负责底层draw UI的类UIPainter，用OpenGL做底层API的话就实现一个GLUIPainter，如果用DirectX做渲染的话就实现一个DXUIPainter.&lt;br /&gt;这个类被UIContext调用。&lt;br /&gt;(2)一个负责管理窗口的UIContext类，工作包括记录自己的windows(大小位置等)，响应keyboard/mouse的输入，对用UIPainter来画UI.&lt;br /&gt;提供了GlutUIContex作为adapter，是否也可以实现Win32UIContext, QtUIContext.&lt;br /&gt;(3)这个nvwidgets目的只是在glut提供的窗口上用OpenGL来画出UI和相应这些UI，&lt;br /&gt;like the author of this project said, it is suitable for small dome.&lt;br /&gt;假如是在Win32上实现，不知是否类似。&lt;br /&gt;假如是在Qt上实现，Qt好像是提供class QPainter to render 2D widgets.&lt;br /&gt;(4)另外，貌似提供的example占用99%CPU.&lt;br /&gt;原来可能是:&lt;br /&gt;static void idle()&lt;br /&gt;{&lt;br /&gt;glutPostRedisplay();&lt;br /&gt;}&lt;br /&gt;glutIdleFunc(idle);&lt;br /&gt;When the application is idle(not responding to event), it refresh constantly(also often used to implement animation).&lt;br /&gt;&lt;br /&gt;Email from the author:&lt;br /&gt;&lt;br /&gt;That's expected. nvwidgets processes the input and draws the screen&lt;br /&gt;simultaneously. It was designed for real-time applications that are&lt;br /&gt;constantly redrawing the screen, so in those cases that was not an&lt;br /&gt;issue.&lt;br /&gt;&lt;br /&gt;This however is one of the main complains people have; there's an&lt;br /&gt;issue already open about it:&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/nvidia-widgets/issues/detail?id=1&lt;br /&gt;&lt;br /&gt;the IMGUI forums also discuss this issue and propose solutions:&lt;br /&gt;&lt;br /&gt;https://mollyrocket.com/forums/viewforum.php?f=10&lt;br /&gt;&lt;br /&gt;A simple workaround is not to refresh the screen constantly, but limit&lt;br /&gt;it to 60 or 30 Hz. That can be achieved with WaitableTimers. See the&lt;br /&gt;comment section of the following article:&lt;br /&gt;&lt;br /&gt;http://cbloomrants.blogspot.com/2009/03/03-02-09-sleep-sucks-and-vsync-woes.html&lt;br /&gt;另外涉及的link including:&lt;br /&gt;http://meshula.net/wordpress/?p=189&lt;br /&gt;http://www.gamedev.net/community/forums/topic.asp?topic_id=445787&amp;amp;whichpage=2?&lt;br /&gt;&lt;br /&gt;问题包括:&lt;br /&gt;(4.1) 游戏shot CPU usage to 100%是否合适? 意见包括对于real-time application来说，this 's not an issue. 反面意见是, the computer's fans roar like a vacuum cleaner. Power consumption. Expecially for a loptop.&lt;br /&gt;(4.2) 如果不想要100%usage, then not to refresh the screen constantly, but limit it to a framerate 60 or 30 Hz. But how? using timer, 方法一般是:&lt;br /&gt;Use a timer to record the time at which you started rendering the current frame. Add 1/120th of a second to that, and you know when the next frame should start.&lt;br /&gt;Once you've finished rendering the current frame, you take the current time, and check how far it is from the "next frame" time we computed.&lt;br /&gt;Then you call Sleep(int) with the time difference.&lt;br /&gt;同样地在上面提到的cbloomrants.blogspot.com那个link中有伪代码.&lt;br /&gt;&lt;br /&gt;但是好像windows上的Sleep() is a huge disaster, it's not exact.&lt;br /&gt;&lt;br /&gt;(5) What is &lt;strong&gt;IMGUI&lt;/strong&gt;?&lt;br /&gt;https://mollyrocket.com/forums/viewforum.php?f=10&lt;br /&gt;http://sol.gfxile.net/imgui/&lt;br /&gt;http://sol.gfxile.net/files/Assembly07_IMGUI.pdf&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1873691008368494982?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1873691008368494982/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/04/nvidia-widgets-gui.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1873691008368494982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1873691008368494982'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/04/nvidia-widgets-gui.html' title='Nvidia widgets (gui)'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1723057184456824494</id><published>2009-03-26T11:14:00.008+08:00</published><updated>2009-06-13T18:55:14.940+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphics engine'/><category scheme='http://www.blogger.com/atom/ns#' term='architeture'/><title type='text'>Graphics Engine Architeture</title><content type='html'>2009-03-26&lt;br /&gt;&lt;br /&gt;1. when i was trying to implement one paper and see how it work, most of the time, i use glut. Actually, the framework with trackball function in Meshcourse07 and Nvidia OpenGL SDK 10.5 is good enough to meet my this simple need.&lt;br /&gt;&lt;br /&gt;2. 但是当设计的模块多了之后，之前简单的在一个framework中mix了数据和显示这方面会显得极为混乱.&lt;br /&gt;例如有一个Bezier Curves class, only deal with the data and operators cared by the curve itself.&lt;br /&gt;还有一个是复杂显示的RenderDevice class, wrapper for opengl commands and rendering engine.&lt;br /&gt;为了做到两者可以互不相关，&lt;br /&gt;需要提供一个中间的协调者:&lt;br /&gt;#include "BezierCurve"&lt;br /&gt;#include "RenderDevice"&lt;br /&gt;class Whatever {&lt;br /&gt;  BezierCurve *;&lt;br /&gt;  render(RenderDevice *) {}&lt;br /&gt;  controlBezier(UserInput *) { // call the functions fo BezierCurves }&lt;br /&gt;  ...&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;3. 更复杂的还设计GUI widgets模块，windows窗口模块等，这些还需要继续了解。现在正在看G3D graphics engine的实现.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&gt; 09-04-17&lt;br /&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_3ksWOBRDci4/SegGE_x8VUI/AAAAAAAAAGE/ZFTJ8G1aViI/s1600-h/Essential+mathematics+for+games+and+interactive+applications.jpg"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 210px; FLOAT: left; HEIGHT: 209px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5325513242275763522" border="0" alt="" src="http://2.bp.blogspot.com/_3ksWOBRDci4/SegGE_x8VUI/AAAAAAAAAGE/ZFTJ8G1aViI/s320/Essential+mathematics+for+games+and+interactive+applications.jpg" /&gt;&lt;/a&gt; &lt;a href="http://3.bp.blogspot.com/_3ksWOBRDci4/SegEeQJT6xI/AAAAAAAAAF0/WsVjVUiRF24/s1600-h/3DGEA.jpg"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 174px; FLOAT: left; HEIGHT: 223px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5325511477142219538" border="0" alt="" src="http://3.bp.blogspot.com/_3ksWOBRDci4/SegEeQJT6xI/AAAAAAAAAF0/WsVjVUiRF24/s320/3DGEA.jpg" /&gt;&lt;/a&gt; &lt;a href="http://1.bp.blogspot.com/_3ksWOBRDci4/SegEuU4haPI/AAAAAAAAAF8/T8x0h488qw4/s1600-h/book.png"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 208px; FLOAT: left; HEIGHT: 216px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5325511753291884786" border="0" alt="" src="http://1.bp.blogspot.com/_3ksWOBRDci4/SegEuU4haPI/AAAAAAAAAF8/T8x0h488qw4/s320/book.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;1. The first is "Essential &lt;strong&gt;&lt;span style="color:#3333ff;"&gt;mathematics&lt;/span&gt;&lt;/strong&gt; for games and interactive applications".&lt;/p&gt;&lt;p&gt;2. The second one is related to the "&lt;a href="http://www.geometrictools.com/index.html"&gt;&lt;span style="color:#009900;"&gt;&lt;strong&gt;Wild Magic&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt; Game Engine", the third 貌似不是关于技术的，虽然其作者的 &lt;span style="color:#ffcc33;"&gt;&lt;strong&gt;G3D&lt;/strong&gt;&lt;/span&gt; Graphic Engine 很吸引。&lt;/p&gt;&lt;p&gt;&gt;2009-5-29 &lt;a href="http://www.songho.ca/opengl/gl_mvc.html"&gt;OpenGL Windows GUI Application&lt;/a&gt; MVC框架，multi-thread, 结合opengl来讲，很好。But, still call the gl command in the Model part, what to do is the data in the Model needed to be render ?&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1723057184456824494?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1723057184456824494/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/03/graphics-engine-architeture.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1723057184456824494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1723057184456824494'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/03/graphics-engine-architeture.html' title='Graphics Engine Architeture'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_3ksWOBRDci4/SegGE_x8VUI/AAAAAAAAAGE/ZFTJ8G1aViI/s72-c/Essential+mathematics+for+games+and+interactive+applications.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-8576886157561204477</id><published>2009-03-23T22:29:00.004+08:00</published><updated>2009-07-06T16:13:09.109+08:00</updated><title type='text'>有用的文章链接</title><content type='html'>&lt;a href="http://www.rgba.org/webpages/articles.php?id=5"&gt;Better, smaller and faster random number generator&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.jelovic.com/articles/using_namespaces.htm"&gt;Using Namespaces Properly&lt;/a&gt; 减少namespace冲突的几率.&lt;br /&gt;&lt;a href="http://www.jelovic.com/articles/cpp_without_memory_errors_slides.htm"&gt;C++ Without Memory Errors&lt;/a&gt; :garbage collection, reference count, small pointer.&lt;br /&gt;&lt;a href="http://www.jelovic.com/articles/smart_pointer_thread_safety.htm"&gt;Smart Pointer Thread Safety&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://local.wasp.uwa.edu.au/~pbourke/geometry/pointline/"&gt;Minimum Distance between a Point and a Line&lt;/a&gt;&lt;br /&gt;&lt;a href="http://local.wasp.uwa.edu.au/~pbourke/geometry/pointline/"&gt;Minimum Distance between a Point and a Plane&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.humus.name/index.php?ID=265"&gt;Some thoughts on the compute shader and the future&lt;/a&gt; So what's separating a GPU from a CPU? The difference is in how it approaches long latency operations, in particular memory accesses. Cpu use a large mount of caches, while Gpu use multi-thread. what is a thread is Gpu? ....&lt;br /&gt;&lt;br /&gt;&lt;a href="http://theinstructionlimit.com/?p=14" rel="bookmark"&gt;Gaussian Blur Experiments&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ai-blog.net/archives/2008_07.html"&gt;Fixing Pathfinding Once and For All&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-8576886157561204477?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/8576886157561204477/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/03/blog-post.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8576886157561204477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8576886157561204477'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/03/blog-post.html' title='有用的文章链接'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-8576330222605218278</id><published>2009-03-05T21:29:00.004+08:00</published><updated>2009-05-10T20:19:51.683+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='subdivision surface'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><category scheme='http://www.blogger.com/atom/ns#' term='Bezier Patch'/><title type='text'>Curve Bezier Patch, Tessellation</title><content type='html'>&lt;strong&gt;&lt;span style="color:#cc6600;"&gt;Main Point is: &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;输入: 给出一个初始的原始网格(一般是比较coarse的啦，否则就没有必要进行tessellation了)。&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;过程：微观上，对网格的中每一个面face(可能是triangle or quad)，生成一个对应的控制面片，宏观上，这个原始网格就得到一个对应的控制网格了。&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;输出：上面生成的控制网格，要是看做是control points for bezier patches, then 给出参数坐标(u,v)不就对应于bezier patch上的某一个点了吗？整个控制网格得到的整个bezier曲面因此起到逼近approximate一开始作为输入的那个原始网格的效果。&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;难点在于怎么求控制网格/控制点，使得最好的patches直接能smooth, C1/G1。以及跟新的gpu pileline结合起来。&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc6600;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#cc6600;"&gt;PN Triangles&lt;/span&gt;&lt;/strong&gt;:&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_v1BqZujzE0E/SbUl6wPQdpI/AAAAAAAAABo/GImyP3XGo_w/s1600-h/my.implement.PN.bmp"&gt;&lt;img style="WIDTH: 400px; HEIGHT: 264px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5311193026864903826" border="0" alt="" src="http://3.bp.blogspot.com/_v1BqZujzE0E/SbUl6wPQdpI/AAAAAAAAABo/GImyP3XGo_w/s400/my.implement.PN.bmp" /&gt;&lt;/a&gt;&lt;br /&gt;实现上本来很简单，但是我之前竟然弄了个很严重的错误，就是先求了原是网格的Loop limit surface再对这求PN。得到的PN triangle应该是interpolate原始网格的。&lt;br /&gt;Reference：A.Vlachos, J.Peters, etc. Curved PN Triangles, 2001.&lt;br /&gt;之后的工作还包括：怎么改善连续性，怎么加入sharp features，怎么扩展到triangle-quads等。详细的内容请google。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Tamy Boubekeur 的主页上继Scalar tagged PN, &lt;strong&gt;&lt;span style="color:#cc9933;"&gt;QAS&lt;/span&gt;&lt;/strong&gt;, Subdivision Shading, Phong Tessellation之后又有新东西了，&lt;a href="http://perso.telecom-paristech.fr/~boubek/tessellation/index.html"&gt;Realtime tessellation&lt;/a&gt;, 好像是他在这方面工作的一个总结，期待当中。&lt;br /&gt;update 2009-05-10, &lt;a href="http://bouliiii.blogspot.com/2008/08/quadratic-approximation-of-subdivision.html"&gt;quadratic-approximation-of-subdivision&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://castano.ludicon.com/blog/2009/01/07/approximate-subdivision-shading/"&gt;Approximate Subdivision Shading&lt;/a&gt; 这篇文章提供了三方面的信息。1. 评论Subdivision Shading工作, 2. 将Subdivision Shading的方法跟下面将要提到的&lt;span style="color:#cc0000;"&gt;&lt;strong&gt;ACC&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;结合起来，文中没有说得太仔细，但是我估计是在得到ACC的geometry patch之后，再求geometry patch上每一个顶点的normal(其one-ring faces的normals的avarage), 不需要求tangent patch了当然，在对geometry patch做evaluation的时候，同时对其上面的normals也做相同的evaluation。3. to achieve watertight surfaces when using displacement maps。&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C. Loop &amp;amp; S. Schaefer的Approximation Catmull-Clark Subdivision surfaces with Bicubic Patches[&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;ACC&lt;/span&gt;&lt;/strong&gt;], 2007/2008. 现在的确比上面提到的PN, QAS都要热，一方面是因为现在DirectX11上新加入的tessellation功能. C. Loop本来就在Ms工作，估计这个ACC工作本来就跟D11的开发相结合的。 相关的连接(1).&lt;a href="http://developer.download.nvidia.com/presentations/2008/Gamefest/Gamefest2008-DisplacedSubdivisionSurfaceTessellation-Slides.PDF" target="_blank"&gt;Tessellation of Displaced Subdivision Surfaces in DX11&lt;/a&gt; (2).&lt;a href="http://developer.nvidia.com/object/siggraph-2008-Subdiv.html"&gt;Siggraph 2008: Next-Generation Rendering of Subdivision Surfaces&lt;/a&gt; 。&lt;br /&gt;&lt;br /&gt;ACC上面没有考虑到sharp features, 因此有了&lt;a href="http://castano.ludicon.com/blog/2009/01/27/real-time-creased-approximate-subdivision-surfaces/"&gt;Real-time creased Approximatie subdivision surfaces&lt;/a&gt;,2009.&lt;br /&gt;&lt;a href="http://castano.ludicon.com/blog/2009/01/10/10-fun-things-to-do-with-tessellation/"&gt;10 Fun Things to do with Tessellation&lt;/a&gt; Hardware tessellation这个new tool有什么好玩的功能呢? 看看这个文章啦:-)&lt;br /&gt;&lt;span style="color:#990000;"&gt;[Mar 26,09 update]&lt;/span&gt;虽然比Nvidia慢，但是ATI/AMD终于就在HW上实现ACC了 "&lt;a href="http://developer.amd.com/GPU/WGSDK/Pages/default.aspx"&gt;OpenGL Tessellation Samples&lt;/a&gt;", 看来ACC真的太hot了，刚下载了demo来编译运行, 可惜我的RV380(Radeon X600)不支持。另外，因为ACC的实现需要one-ring neighborhood的信息，而在GPU中怎么能看到一个primitive vertex/face的邻域信息呢，并且还是在pipeline的前段，在vertex unpacked之前?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cise.ufl.edu/research/SurfLab/pubs.shtml" target="_blank"&gt;http://www.cise.ufl.edu/research/SurfLab/pubs.shtml&lt;/a&gt; 其中一个做细分曲面做得最好的实验室，上面N多好papers。而其中就有1, Smooth surfaces from 4-sided facets 2008; 2. Fast Paralled construction of smooth surfaces for meshes with tri/quad/poly 2008等和就网格生成smooth的Bezier patches并用GPU加速相关的工作。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;当然在Tessellation得到bezier patches之后，可以在上面使用normal mapping, displacement mapping等来加添显示效果。&lt;br /&gt;另外这里涉及一个watertightness的问题，怎么样使得相邻的patches之间不出现缝隙，这个倒没有深究。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-8576330222605218278?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/8576330222605218278/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/03/curve-bezier-patch-tessellation.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8576330222605218278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8576330222605218278'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/03/curve-bezier-patch-tessellation.html' title='Curve Bezier Patch, Tessellation'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_v1BqZujzE0E/SbUl6wPQdpI/AAAAAAAAABo/GImyP3XGo_w/s72-c/my.implement.PN.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-5888551826548632888</id><published>2009-03-03T14:30:00.001+08:00</published><updated>2009-04-14T22:31:09.821+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='box-spline'/><category scheme='http://www.blogger.com/atom/ns#' term='subdivision surface'/><category scheme='http://www.blogger.com/atom/ns#' term='B spline'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Unified subdiviaion schemes based on the Sqrt2 subdivision operator</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_v1BqZujzE0E/SazR3p34FKI/AAAAAAAAAA0/Zv6YK4z2NAU/s1600-h/1.bmp"&gt;&lt;/a&gt;刚完成了相关的工作并submit了，希望有个好的结果啦。 &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;我是January从Dr. Li那里接手这个工作的，当时刚完成了approximation of Loop subdivision surfaces的工作，开始时候怎么也看不懂，因为涉及到了box-spline，而我对b-spline也都一头雾水，去google这个什么box-spline，download下来的paper都是公式公式，唯一的收获还是“可惜自己不是数学系的”。但是也不想问老师，因为听老师说会上手得快很多，但是像吃饭，一口下去吞了也就吞了，什么味道都不知道呢。于是，一直拖到寒假，晚上在家里看看，推推导，画画图，慢慢竟然有点feel了。之后，就coding，一切都顺利，使得我以为也不着急。但是到了2月中旬，发现需要在3.1号之前搞定，马上进入crease features的处理，于是，意料之外的痛苦开始了……&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;two weeks以后，工作完了，文章submit了，虽然还是不知道什么是box-spline，但是貌似效果还不错的：&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_v1BqZujzE0E/SazR3p34FKI/AAAAAAAAAA0/Zv6YK4z2NAU/s1600-h/1.bmp"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 400px; DISPLAY: block; HEIGHT: 299px; CURSOR: pointer" id="BLOGGER_PHOTO_ID_5308848814826198178" border="0" alt="" src="http://1.bp.blogspot.com/_v1BqZujzE0E/SazR3p34FKI/AAAAAAAAAA0/Zv6YK4z2NAU/s400/1.bmp" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Main References:&lt;/div&gt;&lt;div&gt;1. on subdivision schemes generalizing uniform b-spline surfaces of arbitrary degree. J.Stam. 2001.&lt;/div&gt;&lt;div&gt;2. Composite sqrt2 subdivision surfaces. Guiqing Li and W. Ma. 2006/2007.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-5888551826548632888?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/5888551826548632888/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/03/unified-subdiviaion-schemes-based-on.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5888551826548632888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/5888551826548632888'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/03/unified-subdiviaion-schemes-based-on.html' title='Unified subdiviaion schemes based on the Sqrt2 subdivision operator'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_v1BqZujzE0E/SazR3p34FKI/AAAAAAAAAA0/Zv6YK4z2NAU/s72-c/1.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-2732789800685389373</id><published>2008-09-17T15:37:00.002+08:00</published><updated>2009-04-15T13:31:27.909+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='laplacian'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Laplacian Smoothing 拉普拉斯平滑</title><content type='html'>Question: if I do &lt;strong&gt;&lt;span style="color:#cc0000;"&gt;laplacian smoothing&lt;/span&gt;&lt;/strong&gt; to a model many many many times, what happen???&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_v1BqZujzE0E/SNC0dye_k9I/AAAAAAAAAAo/tUBrQs_HC0s/s1600-h/LS.jpg"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; DISPLAY: block; CURSOR: hand" id="BLOGGER_PHOTO_ID_5246891989747602386" border="0" alt="" src="http://1.bp.blogspot.com/_v1BqZujzE0E/SNC0dye_k9I/AAAAAAAAAAo/tUBrQs_HC0s/s400/LS.jpg" /&gt;&lt;/a&gt; 上面的图是对horse模型的不断平滑结果，结果是收敛为一点（这个图没有贴上来，上面的图已经足够看到这个trend了）！！！&lt;br /&gt;Reference: Skeleton Extraction by Mesh Contraction. ACM TOC 2008.&lt;br /&gt;&lt;div&gt;"Laplacian Smoothing that moves vertices along their approximation curvature normal directions. Note that an unconstrained normal flow of the vertices would progressively smooth out all the details of the model and &lt;strong&gt;&lt;span style="color:#cc0000;"&gt;converge into a single point&lt;/span&gt;&lt;/strong&gt;."&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-2732789800685389373?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/2732789800685389373/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/09/laplacian-smoothing.html#comment-form' title='1 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2732789800685389373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2732789800685389373'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/09/laplacian-smoothing.html' title='Laplacian Smoothing 拉普拉斯平滑'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_v1BqZujzE0E/SNC0dye_k9I/AAAAAAAAAAo/tUBrQs_HC0s/s72-c/LS.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1573217780770773301</id><published>2008-09-17T10:07:00.001+08:00</published><updated>2009-04-14T22:31:54.890+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='subdivision surface'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Interpolaton Loop Subdivision Surface</title><content type='html'>mentor好像对此有兴趣，所以暑假实习期间我就实现了这个文章，效果如下，可惜当时没有跟用于插值的Butterfly subdivision做比较。&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_v1BqZujzE0E/SNBoBb4yZtI/AAAAAAAAAAg/R0cpy0x0e2M/s1600-h/int.JPG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; FLOAT: left; CURSOR: hand" id="BLOGGER_PHOTO_ID_5246807939761727186" border="0" alt="" src="http://2.bp.blogspot.com/_v1BqZujzE0E/SNBoBb4yZtI/AAAAAAAAAAg/R0cpy0x0e2M/s400/int.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_v1BqZujzE0E/SNBn6tYfRiI/AAAAAAAAAAY/_r6ekETFIfY/s1600-h/int.JPG"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_v1BqZujzE0E/SNBnigRPeuI/AAAAAAAAAAQ/3PFavHU5ado/s1600-h/int.JPG"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Reference:&lt;/div&gt;&lt;div&gt;Interpolation by geometric algorithm. Takashi Maekawa, etc. 2006.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1573217780770773301?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1573217780770773301/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/09/interpolaton-loop-subdivision-surface.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1573217780770773301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1573217780770773301'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/09/interpolaton-loop-subdivision-surface.html' title='Interpolaton Loop Subdivision Surface'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_v1BqZujzE0E/SNBoBb4yZtI/AAAAAAAAAAg/R0cpy0x0e2M/s72-c/int.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-6120064411451984514</id><published>2008-09-11T12:35:00.001+08:00</published><updated>2009-04-14T22:35:27.826+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='surface'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Metaballs</title><content type='html'>第一次听到这个概念是关于一个叫spore的游戏。&lt;br /&gt;&lt;br /&gt;Gamedev近来有一片介绍metoball的文章 &lt;a href="http://www.gamedev.net/reference/programming/features/isometa2d/"&gt;Exploring Metaballs and Isosurfaces in 2D&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-6120064411451984514?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/6120064411451984514/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/09/metaballs.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/6120064411451984514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/6120064411451984514'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/09/metaballs.html' title='Metaballs'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1817951300845932318</id><published>2008-08-21T12:50:00.000+08:00</published><updated>2009-04-14T20:59:53.462+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bezier'/><category scheme='http://www.blogger.com/atom/ns#' term='subdivision surface'/><category scheme='http://www.blogger.com/atom/ns#' term='B spline'/><category scheme='http://www.blogger.com/atom/ns#' term='OpenGL'/><category scheme='http://www.blogger.com/atom/ns#' term='patch'/><title type='text'>How to Draw Bezier, B spline, patch, or Subdivision Surface using OpenGL?</title><content type='html'>Conception:&lt;br /&gt;&lt;a href="http://groups.csail.mit.edu/graphics/classes/6.837/F04/lectures/16_curves_surfaces.pdf"&gt;http://groups.csail.mit.edu/graphics/classes/6.837/F04/lectures/16_curves_surfaces.pdf&lt;/a&gt;&lt;br /&gt;Explain what is &lt;span style="color:#ff0000;"&gt;Bezier&lt;/span&gt;, &lt;span style="color:#009900;"&gt;B-spline&lt;/span&gt;(=uniform cubic BSpline, 是rational的), &lt;span style="color:#3333ff;"&gt;NURBS&lt;/span&gt;(=Non-Uniform Rational BSpline).  直观地，只考虑4个顶点的，order = 4，degree = order -1 = 3，Bezier curve是插值头尾两个控制点的，而且每递增3个新控制点才新产生一段curve，之后两端curve的接缝点只是几何坐标值相等，但是切向tangent却不连续；相比之下，Bspline curve并不插值首位两个顶点，每递增1个新控制点就产生一段curve，前后两端curve连续并且切向一直。&lt;br /&gt;Q(t) = GBT(t) = Geometry(4*1 vector of four control points) * Spline Basic (4*4 matrix) * Power Basic([t^3, t^2, t, 0]).&lt;br /&gt;它很绚的作业在&lt;a href="http://groups.csail.mit.edu/graphics/classes/6.837/F04/assignments/assignment8/"&gt;http://groups.csail.mit.edu/graphics/classes/6.837/F04/assignments/assignment8/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;OpenGL FAQ, 19.010 How can I use OpenGL evaluators to create a B-spline surface?&lt;br /&gt;OpenGL &lt;strong&gt;&lt;span style="color:#990000;"&gt;evaluat&lt;/span&gt;&lt;span style="color:#990000;"&gt;ors &lt;/span&gt;&lt;/strong&gt;use a Bezier basis. To render a surface using any other basis, such as B-spline, you must convert your control points to a Bezier basis. The &lt;a href="http://www.opengl.org/resources/faq/technical/gettingstarted.htm#gett0004" minmax_bound="true"&gt;OpenGL Programming Guide&lt;/a&gt;, Chapter 12, lists a number of reference books that cover the math behind these conversions.&lt;br /&gt;&lt;br /&gt;首先，OpenGL/glu使用的evaluater是直接提供Bezier curve/NURBS的支持，但是B-spline就没有啦。结果是，B-spline curve都要转成Bezier curve来画啦。可以参考E.Angel's curves.c这例子。&lt;br /&gt;&lt;br /&gt;E. Angel, Interactive Computer Graphics , A Top-Down Approach with OpenGL, Third Edition Addison-Wesley Longman, 2003. 这书上有一个curves.c的&lt;strong&gt;&lt;span style="color:#990000;"&gt;可运行例子&lt;/span&gt;&lt;/strong&gt;，可以画Bezier，b-spline 以及interpolation curve，不错的。OpenGL虽然内部只支持Bezier但是由于b-spline与Bezier相互间可以转换，因此，用户给出b-spline控制点要画cure时候，我们就求要画同样一段curve用Bezier控制点的话这些Bezier控制点的坐标是什么呢？求出这些Bezier控制点坐标之后，这段curve就可以用OpenGL的evaluater来画了。E.Angel's curves.c例子就是利用了同一段curve可以用Bezier控制点来得到，也可以用b-spline控制点来得到。&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.itee.uq.edu.au/~comp4201/Curves6.pdf"&gt;http://www.itee.uq.edu.au/~comp4201/Curves6.pdf&lt;/a&gt;&lt;br /&gt;这个ppt(curve and surface in OpenGL)里面不是介绍曲线的数学表达式，而是实际上怎样用&lt;br /&gt;&lt;span style="color:#990000;"&gt;glMap1f&lt;/span&gt;(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &amp;amp;newcpts[0][0]);&lt;br /&gt;&lt;span style="color:#990000;"&gt;glMapGrid1f&lt;/span&gt;(30, 0.0, 1.0);       &lt;br /&gt;&lt;span style="color:#990000;"&gt;glEvalMesh1&lt;/span&gt;(GL_LINE, 0, 30);这些&lt;span style="color:#990000;"&gt;具体&lt;/span&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt;画curve的函数&lt;/span&gt;&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dgp.toronto.edu/~hertzman/stroke/"&gt;http://www.dgp.toronto.edu/~hertzman/stroke/&lt;/a&gt;&lt;br /&gt;里面的代码是在&lt;a href="http://www.mrl.nyu.edu/projects/npr/painterly/"&gt;painterly rendering papers&lt;/a&gt; to draw brush strokes in OpenGL，除了画Bezier和Bspline curve之后还有一些NPR的资料以及siggraph 02的course note。&lt;br /&gt;&lt;br /&gt;Google Code, search Bspline.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1817951300845932318?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1817951300845932318/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/08/how-to-draw-bezier-b-spline-patch-or.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1817951300845932318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1817951300845932318'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/08/how-to-draw-bezier-b-spline-patch-or.html' title='How to Draw Bezier, B spline, patch, or Subdivision Surface using OpenGL?'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3293028755963158320</id><published>2008-08-18T15:05:00.001+08:00</published><updated>2009-05-27T18:36:51.807+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenGL'/><category scheme='http://www.blogger.com/atom/ns#' term='transformation'/><title type='text'>OpenGL Transformation</title><content type='html'>Modelview（Modeling and Viewing） Transformation:&lt;br /&gt;&lt;br /&gt;“First of all, telling about the order of matrices in a matrix product is senseless as long as nothing was said about using either column or row vectors. OpenGL uses column vectors, while D3D uses row vectors.” 这是必须先明确的，OpenGL中 v_new = M * v_old, where M is 4*4, and v_new , v_old is 4*1.&lt;br /&gt;&lt;br /&gt;仔细阅读红宝书第三章(&lt;a href="http://www.glprogramming.com/red/chapter03.html"&gt;http://www.glprogramming.com/red/chapter03.html&lt;/a&gt;)里面介绍了可以从两个角度来看待矩阵变换次序。&lt;br /&gt;&lt;br /&gt;首先，OpenGL中维护一个C is current modelview matrix. All viewing and modeling transformations are represented as 4*4 matrices, 用M表示。之后无论是直接用glMultMatrix*() or transformation command(glT/R/S) 其实就是将变换矩阵M后乘当前的C矩阵得到C*M，&lt;br /&gt;然后在v' = C*M*v.&lt;br /&gt;&lt;br /&gt;利用红宝书中的例子:&lt;br /&gt;glMatrixMode(GL_MODELVIEW);&lt;br /&gt;glLoadIdentity();&lt;br /&gt;glMultMatrixf(N); /* apply transformation N */&lt;br /&gt;glMultMatrixf(M); /* apply transformation M */&lt;br /&gt;glMultMatrixf(L); /* apply transformation L */&lt;br /&gt;glBegin(GL_POINTS);&lt;br /&gt;glVertex3f(v); /* draw transformed vertex v */&lt;br /&gt;glEnd();&lt;br /&gt;先将C设置I, C' = CNML, v' = C'v = INMLv.&lt;br /&gt;这个理解一般没有异议，解决了code顺序与矩阵乘法次序概念上问题。&lt;br /&gt;也就是说如果你都写好了code，叫我将矩阵写出来当然没有问题；反过来，你给出里NML，让我将code写出来，这也好办。&lt;br /&gt;但是，从用户/写代码的人来看，当我需要将一个object/vertex怎么变怎么变，又不知道具体的矩阵M，我怎么做呢？&lt;br /&gt;&lt;br /&gt;关键要理解glTranslate*, and glRotate*的次序，红宝书中那先旋转还是先平移的例子要好好看。&lt;br /&gt;&lt;br /&gt;glMatrixMode(GL_MODELVIEW);&lt;br /&gt;glLoadIdentity();&lt;br /&gt;glMultMatrixf(T); /* translation */&lt;br /&gt;glMultMatrixf(R); /* rotation */&lt;br /&gt;draw_the_object();&lt;br /&gt;&lt;br /&gt;1. "fixed coordinate system - in which matrix multiplications affect the position, orientation, and scaling of &lt;span style="color:#000099;"&gt;your model&lt;/span&gt; - you have to think of the multiplications as occurring in the opposite order from how they appear in the code. "&lt;br /&gt;从一个&lt;strong&gt;&lt;span style="color:#000099;"&gt;固定的全局的&lt;/span&gt;&lt;/strong&gt;，可以理解为世界坐标来看的话，代码从后往前考虑，NMLv是L, M, N依次作用于v。这个"&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000099;"&gt;your model&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#000000;"&gt;为什么呢？书中的意思是从固定的这坐标系来看待时候，不要考虑你的物体坐标，反正我就是影响你这个物体的每一个点在我这个固定坐标里面的位置。&lt;/span&gt;&lt;br /&gt;上面例子从固定的世界坐标来看的话，物体先被绕着固定世界坐标系的原点旋转，再沿着世界坐标系来平移，根本不用考虑什么物体坐标系。&lt;br /&gt;&lt;br /&gt;2. “Another way to view matrix multiplications is to forget about &lt;span style="color:#000099;"&gt;&lt;strong&gt;a grand, fixed coordinate system in which your model is transformed&lt;/strong&gt;&lt;/span&gt; and instead imagine that &lt;strong&gt;&lt;span style="color:#990000;"&gt;a local coordinate system is tied to the object you're drawing. All operations occur relative to this changing coordinate system&lt;/span&gt;&lt;/strong&gt;. With this approach, the matrix multiplications now appear in the natural order in the code. (Regardless of which analogy you're using, the code is the same, but how you think about it differs.) ”&lt;br /&gt;从&lt;strong&gt;&lt;span style="color:#990000;"&gt;物体的局部坐标&lt;/span&gt;&lt;/strong&gt;系来看，有一个物体本身的坐标系跟物体本身绑定在一起，&lt;span style="color:#990000;"&gt;所有变换都会作用于这个物体的坐标系&lt;/span&gt;(同时由于物体是对于这个自己的坐标系来说的，所以物体跟着自己局部坐标系也被变换了)。&lt;br /&gt;于是上面的例子中，物体的坐标系先被平移了，然后物体的坐标系绕着自己的原点来旋转。整个过程当中，世界坐标依然没有变，而且物体一直跟着自己的物体坐标系变化。 对于想树形结构的物体，如机械人，太阳系，红宝书的建议是从局部坐标来看。&lt;br /&gt;&lt;br /&gt;========&lt;br /&gt;上面的问题弄清楚就看为什么人家常说要先做scale, then rotate, translate last呢？&lt;br /&gt;v' = T*R*S*v&lt;br /&gt;从全局的角度来看（也就是从后往前看），先做scale的话，scale之后的3个轴还是与scale之前的方向一样，虽然长度变了，但这不影响下面的Rotation变换。&lt;br /&gt;从局部物体角度来看（也就是从前往后看），物体本身的坐标先做旋转，物体也跟着旋转了，之后的缩放，物体的坐标系会被缩放，连带物体也一样。&lt;br /&gt;&lt;br /&gt;========&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;注意：&lt;br /&gt;glRotate*(angle, xAxis, yAxis, zAxis), 其中轴(xAxis, yAxis, zAxis)是通过original的unit vector。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://csc.csudh.edu/jhan/Fall2006/csc461/CourseNotes/CSC461-Lecture16.ppt"&gt;http://csc.csudh.edu/jhan/Fall2006/csc461/CourseNotes/CSC461-Lecture16.ppt&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.juniata.edu/faculty/rhodes/graphics/opengltrans.htm"&gt;http://www.juniata.edu/faculty/rhodes/graphics/opengltrans.htm&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cs.unm.edu/~angel/CS433/LECTURES/CS433_13.pdf"&gt;http://www.cs.unm.edu/~angel/CS433/LECTURES/CS433_13.pdf&lt;/a&gt; 上面三个链接其内容几乎一样的，看这个就可以了。&lt;br /&gt;&lt;br /&gt;&lt;a href="http://pages.cs.wisc.edu/~psilord/docs/local_axis.html"&gt;http://pages.cs.wisc.edu/~psilord/docs/local_axis.html&lt;/a&gt; 难懂&lt;br /&gt;&lt;a href="http://www.songho.ca/opengl/gl_transform.html"&gt;http://www.songho.ca/opengl/gl_transform.html&lt;/a&gt; OpenGL Transformation. 从math上介绍geometry pipline上的变换矩阵，很好.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3293028755963158320?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3293028755963158320/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/08/opengl-transformation.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3293028755963158320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3293028755963158320'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/08/opengl-transformation.html' title='OpenGL Transformation'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-1831404010328159073</id><published>2008-08-18T14:22:00.004+08:00</published><updated>2009-07-11T10:52:11.948+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='glsl'/><category scheme='http://www.blogger.com/atom/ns#' term='gpu'/><category scheme='http://www.blogger.com/atom/ns#' term='OpenGL'/><title type='text'>OpenGL, GLSL Tutorial</title><content type='html'>Immediate mode -&gt; VBO&lt;br /&gt;Light, Texture -&gt; shader&lt;br /&gt;-------------------------------------------------------------------------------&lt;br /&gt;OpenGL tutorial&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;strong&gt;红宝书&lt;/strong&gt;&lt;/span&gt;,&lt;br /&gt;&lt;a href="http://www.codecolony.de/"&gt;http://www.codecolony.de/&lt;/a&gt; 一些入门的例子。&lt;br /&gt;&lt;br /&gt;GLSL&lt;br /&gt;&lt;span style="color:#ff6600;"&gt;&lt;strong&gt;橙色书 OpenGL Shading Language 最快最明了的学习资料&lt;/strong&gt;&lt;/span&gt;,&lt;br /&gt;&lt;a href="http://www.opengl.org/sdk/docs/tutorials/TyphoonLabs/"&gt;http://www.opengl.org/sdk/docs/tutorials/TyphoonLabs/&lt;/a&gt; PDF文档。&lt;br /&gt;&lt;a href="http://nehe.gamedev.net/data/articles/article.asp?article=21"&gt;http://nehe.gamedev.net/data/articles/article.asp?article=21&lt;/a&gt; NEHE21课对glsl的基本概念简介。&lt;br /&gt;&lt;a href="http://www.clockworkcoders.com/oglsl/tutorials.html"&gt;http://www.clockworkcoders.com/oglsl/tutorials.html&lt;/a&gt; 入门例子, 里面有一个libglsl的库帮助使用glsl，看来这是趋势，这样就没有必要每次都自己来compile和link那shader了。&lt;br /&gt;&lt;a href="http://appsrv.cse.cuhk.edu.hk/~ymxie/Geometry_Shader/"&gt;http://appsrv.cse.cuhk.edu.hk/~ymxie/Geometry_Shader/&lt;/a&gt; 几何shader的简介。&lt;br /&gt;&lt;a href="http://cirl.missouri.edu/gpu/"&gt;http://cirl.missouri.edu/gpu/&lt;/a&gt; 一个几何shander的例子。&lt;br /&gt;&lt;br /&gt;Tools， Shader Maker&lt;br /&gt;&lt;a href="http://cg.in.tu-clausthal.de/publications.shtml#shader_maker"&gt;http://cg.in.tu-clausthal.de/publications.shtml#shader_maker&lt;/a&gt;&lt;br /&gt;（里面还有些有趣的论文）。&lt;br /&gt;(1)这个工具很适合入门，它将shader的载入编译以及链接都集成了，用户只需要将网上的vertex /geometry/fragment shader直接黏贴上前，F5就可以看到效果啦。&lt;br /&gt;(2)被作用于shader的mesh是可以从外部载入的，虽然它本身提供了如cube,sphere, torus这里经典模型。这样的好处是，我自己的mesh processing算法对mesh处理之后，放入这里，然后从网上找些shader，就可以看到一些比较不错的render效果了:-)&lt;br /&gt;&lt;br /&gt;NVIDIA&lt;br /&gt;&lt;a href="http://developer.nvidia.com/object/sdk_home.html"&gt;http://developer.nvidia.com/object/sdk_home.html&lt;/a&gt;&lt;br /&gt;nvMath, nvImage, nvModel, nvWidgets,&lt;br /&gt;使用GLEW, png &amp;amp; zlib, 怎么使用nv对gl的extension，&lt;br /&gt;有一个uvShaderUtils.h来帮助使用GLSL.&lt;br /&gt;实现了旋转，缩放，移动模型的操作。&lt;br /&gt;======================&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-1831404010328159073?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/1831404010328159073/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/08/opengl-glsl-tutorial.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1831404010328159073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/1831404010328159073'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/08/opengl-glsl-tutorial.html' title='OpenGL, GLSL Tutorial'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-2527173533423379296</id><published>2008-08-18T14:18:00.002+08:00</published><updated>2009-06-14T11:40:01.383+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VBO'/><category scheme='http://www.blogger.com/atom/ns#' term='OpenGL'/><title type='text'>Vectex Buffer Object</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;红宝书中有一节关于"缓冲区对象中的顶点数组"。&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.spec.org/gwpg/gpc.static/vbo_whitepaper.html"&gt;OpenGL VBOs &lt;/a&gt;specification. VBO is based on the vertex array(which has three steps:enable/define/draw array). 将array data放到server side, 并可以通过mapping得到buffer object的指针进而修改server side那边的data. 最后带有Usage Examples.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.spec.org/gwpg/gpc.static/vbo_whitepaper.html"&gt;http://www.spec.org/gwpg/gpc.static/vbo_whitepaper.html&lt;/a&gt;&lt;a href="http://www.spec.org/gwpg/gpc.static/vbo_whitepaper.html"&gt; &lt;/a&gt;&lt;/p&gt;&lt;p&gt;“VBOs are intended to enhance the capabilities of OpenGL by providing many of the benefits of immediate mode, display lists and vertex arrays, while avoiding some of the limitations. ” &lt;/p&gt;&lt;p&gt;&lt;a href="http://developer.nvidia.com/object/using_VBOs.html"&gt;http://developer.nvidia.com/object/using_VBOs.html&lt;/a&gt;&lt;a href="http://www.spec.org/gwpg/gpc.static/vbo_whitepaper.html"&gt; &lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-2527173533423379296?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/2527173533423379296/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/08/vectex-buffer-object.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2527173533423379296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/2527173533423379296'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/08/vectex-buffer-object.html' title='Vectex Buffer Object'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-4037145161736622812</id><published>2008-07-26T22:27:00.000+08:00</published><updated>2009-04-14T22:29:13.782+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gpu'/><title type='text'>Reading. About GPUs.</title><content type='html'>1. How GPUs work. David Luebke(Nvidia research), Greg Humphreys(University of Virginia)&lt;br /&gt;&lt;a href="http://www.cs.virginia.edu/~gfx/papers/paper.php?paper_id=59"&gt;http://www.cs.virginia.edu/~gfx/papers/paper.php?paper_id=59&lt;/a&gt;&lt;br /&gt;其中D.Luebke名字挺熟悉的，查查看原来是&lt;a href="http://www.cs.virginia.edu/~gfx/papers/paper.php?paper_id=21"&gt;A Developer's Survey of Polygonal Simplification Algorithms&lt;/a&gt;的作者:-)&lt;br /&gt;他的blog上说"On July 24, 2006 I left academia to help start a research group at NVIDIA Corporation", 然后我再看看他的papers介绍，原来他是以做simplification开始的，在Lod方向也许多工作，之后是rendering以及gpu。从academia到corporation，之前的H.Hoppe加入MS也是，没有记错的话做细分的D.zorin加入Pixar....都是idol啊&lt;br /&gt;&lt;br /&gt;2. how gpu works. &lt;br /&gt;  &lt;a href="http://c0de517e.blogspot.com/2008/04/gpu-part-1.html"&gt;http://c0de517e.blogspot.com/2008/04/gpu-part-1.html&lt;/a&gt;&lt;br /&gt;  &lt;a href="http://c0de517e.blogspot.com/2008/04/how-gpu-works-part-2.html"&gt;http://c0de517e.blogspot.com/2008/04/how-gpu-works-part-2.html&lt;/a&gt;&lt;br /&gt;  &lt;a href="http://c0de517e.blogspot.com/2008/04/how-gpu-works-part-3.html"&gt;http://c0de517e.blogspot.com/2008/04/how-gpu-works-part-3.html&lt;/a&gt;&lt;br /&gt;作者的另一个文章&lt;a href="http://c0de517e.blogspot.com/2008/06/begin-here.html"&gt;http://c0de517e.blogspot.com/2008/06/begin-here.html&lt;/a&gt;也是很好的:&lt;br /&gt;do it for fun.&lt;br /&gt;Don't EVER think to know enough. You don't. If you've been programming for 4-5 years and took a 5 years university course, then you will have just the basics that are required to be able to understand almost anything, with some effort. They give you only the alphabet, from there on, there is the real knowledge! That's the single most important advice I can give you.&lt;br /&gt;&lt;br /&gt;最后，要是哪位朋友有下面的书，不知是否可以借阅:-)&lt;br /&gt;Geometric Algebra for Computer Science: An Object-Oriented Approach to Geometry (The Morgan Kaufmann Series in Computer Graphics) (Hardcover)by Leo Dorst (Author), Daniel Fontijne (Author), Stephen Mann (Author)&lt;br /&gt;Real-Time Collision Detection (The Morgan Kaufmann Series in Interactive 3-D Technology) (Hardcover)by Christer Ericson (Author)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-4037145161736622812?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/4037145161736622812/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/07/reading-about-gpus.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4037145161736622812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4037145161736622812'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/07/reading-about-gpus.html' title='Reading. About GPUs.'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-348749100955430588</id><published>2008-04-27T22:26:00.000+08:00</published><updated>2009-04-14T22:27:49.396+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='subdivision surface'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Problem. Evaluation of Hoppe94 Loop Subdivision Surfaces</title><content type='html'>&lt;p&gt;Given a point P(k, v, w) in the initial control mesh, where k is the triangle index, (v, w) is the corresponding barycentric coordiants(u+v+w=1). What is it posiition on the limint surface?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Papers give use the answer: &lt;br /&gt;[1] J.Stam. Exact evaluation of catmull-clark subdivision surfaces at arbitrary parameter values. 1998.&lt;br /&gt;[2] J.Stam. Evaluation of Loop Subdivision Surfaces.&lt;br /&gt;I have implemented the [2], which is a trivial job, for most data (I use the lpdata50Nt.dat) can be downloaded from J.Stam's webpage.&lt;br /&gt;However, if the loop masks are changed, for example, the h.hoppe97, then Stam98's evaluation method and data can not be used directly, because he did not take the feature types into consideration. So.... a big question, i'm still strugglling with it:-)&lt;br /&gt;[3] Denis Zorin.Evaluation of Piecewise Smooth Subdivision Surfaces.2002&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-348749100955430588?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/348749100955430588/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/04/problem-evaluation-of-hoppe94-loop.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/348749100955430588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/348749100955430588'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/04/problem-evaluation-of-hoppe94-loop.html' title='Problem. Evaluation of Hoppe94 Loop Subdivision Surfaces'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-8662840055718735063</id><published>2008-04-27T22:23:00.000+08:00</published><updated>2009-04-14T22:26:20.564+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Hoppe 1994. Improved Loop Subdivision</title><content type='html'>经典的Loop87版本，是对Box-Spline(这我也不懂)的扩展，是没有考虑feature type的。&lt;br /&gt;&lt;br /&gt;H.Hoppe94版本的Loop模式在对顶点的特征类型进行分类基础上，对不同的顶点类型(smooth, dart, crease, corner)使用不同的masks。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-8662840055718735063?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/8662840055718735063/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/04/hoppe-1994-improved-loop-subdivision.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8662840055718735063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8662840055718735063'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/04/hoppe-1994-improved-loop-subdivision.html' title='Hoppe 1994. Improved Loop Subdivision'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3472190539420015559</id><published>2008-04-16T22:22:00.000+08:00</published><updated>2009-04-14T22:23:24.599+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Paper reading: Mesh Deformation</title><content type='html'>现在我自己的工作倒是和mesh deformation没有关系，我在做subdivision surface fitting。However，montor好像有意在这方面做点东西，于是，我也偶尔看点这方面的paper。现在我希望有时间简略整理一下自己看过的，或者有点感觉的东西。&lt;br /&gt;1. Multiresolution deformation&lt;br /&gt;多分率，细节保持的变形。在某一层的变形基础上加上细节。怎么表示细节是一个问题。最简单的就是每一个顶点加一个法相位移。这方面的工作在2000左右热。可以看normal meshes, displace subdivision surfaces，这都是模型的另一种表示方式。&lt;br /&gt;2. Laplace deformation&lt;br /&gt;细节保持的变形，是基于微分空间的变形，就是在微分空间中表示变形。这方面类似的还有gradiant 能量函数，和possion能量函数这些变形方法。siggraph2004热的。&lt;br /&gt;3. Deformation transfor&lt;br /&gt;Deformation transfer for triangle meshes_sig04.Robert W.Sumner&lt;br /&gt;将A模型的变化，转移到B模型，使得B模型也发生类似于A模型的变化。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3472190539420015559?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3472190539420015559/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/04/paper-reading-mesh-deformation.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3472190539420015559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3472190539420015559'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/04/paper-reading-mesh-deformation.html' title='Paper reading: Mesh Deformation'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-869474486074561022</id><published>2008-04-05T22:16:00.000+08:00</published><updated>2009-04-14T22:20:01.923+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='parameterization'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Mesh Parameterization</title><content type='html'>&lt;div&gt;网格参数化的分类。根据base domain是否是平面可以分为平面的参数化和非平面的参数化方法。&lt;br /&gt;而平面参数化方法，被参数化的网格必须有边界，进一步根据其边界在参数化时候是固定的还是自由的，分为固定边界方法和自由边界方法。具体的细节可以参考2007年siggraph course note的相关文章。&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;而我现在实现是Lee98的MAPS方法，将原网格一步一步递进的参数化都一个3D的base domain上。这个base domain是对origianl mesh的simplification的结果。现在的问题是怎么保证参数化结果里面没有triangle 的flipping和reduce 参数化的distortion。&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_3ksWOBRDci4/SeSbVnauprI/AAAAAAAAAA8/RUuZiDWDPiM/s1600-h/20080405.para.bmp"&gt;&lt;img style="WIDTH: 320px; HEIGHT: 194px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5324551455119419058" border="0" alt="" src="http://3.bp.blogspot.com/_3ksWOBRDci4/SeSbVnauprI/AAAAAAAAAA8/RUuZiDWDPiM/s320/20080405.para.bmp" /&gt;&lt;/a&gt;&lt;br /&gt;Reference:&lt;br /&gt;Lee98. MAPS: Multiresolution Adaptive Parameterization of Surfaces.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-869474486074561022?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/869474486074561022/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2008/04/mesh-parameterization.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/869474486074561022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/869474486074561022'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2008/04/mesh-parameterization.html' title='Mesh Parameterization'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_3ksWOBRDci4/SeSbVnauprI/AAAAAAAAAA8/RUuZiDWDPiM/s72-c/20080405.para.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-4098445404685854642</id><published>2007-12-15T22:12:00.002+08:00</published><updated>2009-04-14T22:33:51.951+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='simplification'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Vertex Hierarchy &amp; Truly selective refinement of Progressive meshes</title><content type='html'>&lt;p&gt;&lt;strong&gt;&lt;span style="color:#cc6600;"&gt;Vertex hierarchy&lt;/span&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;所谓的vertex hierarchy就是一个由Node节点组成的forest，这个森林在简化时候建立，森林里面有N课树。&lt;br /&gt;每一棵树的root代表一个简化最后的base mesh上的一个vertex，而它的所有leaf notes都表示形成root note是从哪些vertices来的。也就是说一棵树的节点表示了root节点是怎么形成的，一个树就记录了简化的细节。从一个parent note向下分裂成两个child notes就是vertex split过程，而从两个child notes向上形成一个parent note就是一个halfedge collapse的过程！&lt;br /&gt;vertex hierarchy的结构和简化的过程密切相关，简化过程之后选择的半边的次序不一样的话，最后形成的vertex hierarchy当然也不一样。一旦简化结束之后，这个相应的vertex hierarchy也就是构建完毕了。此后，这个vertex hierarchy可以供selective refinement使用，方便地形成各个level下的mesh，和多分辨率有关系。&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#cc6600;"&gt;Truly selective refinement of Progressive meshes&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;目的：为了能够任意选择当前level下的一个顶点进行vsplit操作，而且每次vsplit只增加一个顶点。&lt;br /&gt;将原来的PM结构中使用的两个关键的原子操作ecol(vs, vt, vu, vl, vr)和vsplit(vs, vt, vu, vl, vr)，改为ecol(vs, vt, vu, vl^, vr^)和vsplit(vs, vt, vu, vl^, vr^).&lt;br /&gt;其中vl^和vr^是original mesh上的原始顶点, 而vl = active ancestor(vl^), vr = active ancestor(vr^). 这个active ancestor的函数是关键，但其实就在vertex hierarchy中体现了！要找一个节点的当前有效的祖先，只需要从这个节点出发，往上找它的当前有效的父节点就可以了。 所谓的“当前有效”，也就是在当前这个分辨率中，在这个level中。&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#cc6600;"&gt;Reference:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;[1]Garland97, QEM&lt;br /&gt;[2]Kim, Lee 2001. Truly selective refinement of progressive meshes.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-4098445404685854642?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/4098445404685854642/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2007/12/vertex-hierarchy-truly-selective.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4098445404685854642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/4098445404685854642'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2007/12/vertex-hierarchy-truly-selective.html' title='Vertex Hierarchy &amp;amp; Truly selective refinement of Progressive meshes'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-9206660510953683622</id><published>2007-11-24T21:47:00.002+08:00</published><updated>2009-04-14T22:34:08.380+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='simplification'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Quadric Error Metric (QEM), Preserving Boundaries -网格简化</title><content type='html'>&lt;p&gt;Garland97的论文中提到为了保护边界在简化的过程当中能尽量幸免，在计算每一个顶点的quadric的时候，是将边界面F沿其边界边e生成一个垂直面，这个垂直面的quadric也加入到e的两个端点的quadric中。详细请看原文的第六节。&lt;br /&gt;下图是我对一个平面过简化效果图：&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_3ksWOBRDci4/SeSWLnAz1mI/AAAAAAAAAAM/qQ_GTJ-8P5M/s1600-h/20071124.1.bmp"&gt;&lt;img style="WIDTH: 192px; HEIGHT: 177px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5324545785653876322" border="0" alt="" src="http://4.bp.blogspot.com/_3ksWOBRDci4/SeSWLnAz1mI/AAAAAAAAAAM/qQ_GTJ-8P5M/s320/20071124.1.bmp" /&gt;&lt;/a&gt; &lt;a href="http://1.bp.blogspot.com/_3ksWOBRDci4/SeSWLpJwd7I/AAAAAAAAAAU/lreJxM_I7WE/s1600-h/20071124.2.bmp"&gt;&lt;img style="WIDTH: 187px; HEIGHT: 174px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5324545786228275122" border="0" alt="" src="http://1.bp.blogspot.com/_3ksWOBRDci4/SeSWLpJwd7I/AAAAAAAAAAU/lreJxM_I7WE/s320/20071124.2.bmp" /&gt;&lt;/a&gt; &lt;a href="http://4.bp.blogspot.com/_3ksWOBRDci4/SeSWLwnaHXI/AAAAAAAAAAc/eu8CDQB_Gi4/s1600-h/20071124.3.bmp"&gt;&lt;img style="WIDTH: 182px; HEIGHT: 172px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5324545788231687538" border="0" alt="" src="http://4.bp.blogspot.com/_3ksWOBRDci4/SeSWLwnaHXI/AAAAAAAAAAc/eu8CDQB_Gi4/s320/20071124.3.bmp" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_3ksWOBRDci4/SeSWMGZkwfI/AAAAAAAAAAk/SRHZp-adoXU/s1600-h/20071124.4.bmp"&gt;&lt;img style="WIDTH: 320px; HEIGHT: 194px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5324545794079244786" border="0" alt="" src="http://3.bp.blogspot.com/_3ksWOBRDci4/SeSWMGZkwfI/AAAAAAAAAAk/SRHZp-adoXU/s320/20071124.4.bmp" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;左图是1089个顶点的原图, 中间是没有加入preserving boundaries控制的100个点的简化图，第三图加入控制后的100个点的简化图，第四图是加入控制后简化为4个顶点的图。&lt;br /&gt;其实加入垂直面的意义是使得边界点更趋向于往尽量成一条直线上的边界点做收缩。也就是说这将要被收缩的两个边界点所在的各自直线（这两直线当然是相连的）尽量不要成90度。因为90度的时候，点到垂直面的距离最大，收缩代价最大（这就是quadric的意义）。&lt;br /&gt;&gt; 2007.12.01&lt;br /&gt;从上面的简化图中，可以看出有些三角形是发生了overlapping，后来加入的防止方法是检测一邻域里面的面的normal的方向的变化，如果变化例如大于90度就当作翻转。 &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-9206660510953683622?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/9206660510953683622/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2007/11/quadric-error-metric-qem-preserving.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/9206660510953683622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/9206660510953683622'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2007/11/quadric-error-metric-qem-preserving.html' title='Quadric Error Metric (QEM), Preserving Boundaries -网格简化'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSWLnAz1mI/AAAAAAAAAAM/qQ_GTJ-8P5M/s72-c/20071124.1.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-8682033814568142079</id><published>2007-11-12T23:39:00.001+08:00</published><updated>2009-04-14T22:34:29.364+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='simplification'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>"Mean Saliency", siggraph2005的论文</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_v1BqZujzE0E/SbUrTQFUcYI/AAAAAAAAACQ/8vnPHhW1pMM/s1600-h/saliency.jpg"&gt;&lt;img style="WIDTH: 276px; HEIGHT: 271px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5311198945288155522" border="0" alt="" src="http://1.bp.blogspot.com/_v1BqZujzE0E/SbUrTQFUcYI/AAAAAAAAACQ/8vnPHhW1pMM/s400/saliency.jpg" /&gt;&lt;/a&gt; &lt;a href="http://4.bp.blogspot.com/_v1BqZujzE0E/SbUrSgqqHkI/AAAAAAAAACI/3jbtVnpg8-A/s1600-h/mean+cur.jpg"&gt;&lt;img style="WIDTH: 281px; HEIGHT: 272px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5311198932559863362" border="0" alt="" src="http://4.bp.blogspot.com/_v1BqZujzE0E/SbUrSgqqHkI/AAAAAAAAACI/3jbtVnpg8-A/s400/mean+cur.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;下面左边是mesh saliency化, 右边是的mean curvature颜色化&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;"Mean Saliency", siggraph2005的论文。 &lt;/div&gt;&lt;div&gt;&lt;br /&gt;概述&lt;br /&gt;将Image中找寻关键部位的概念引入了3D的mesh。所谓关键部位，是指容易吸引人注意力的地方，也许更准确的说是特征部位。在image中，那些部位是shape和lighting的function， 而在mesh中，暂时只考虑geometry/shape。&lt;br /&gt;那么怎么表示mesh中哪些顶点是特征的是关键的呢？它是给每一个顶点一个标量值，也就是saliency(vi)。值大的表示这个点“突出”，值小的表示这个点“一般”。举个例子，一个球形的mesh，其surface上的所有顶点的saliency值都是一样的。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;怎么求顶点的saliency值&lt;br /&gt;论文中给出的算法是：首先假设是在scale 1下，这时，参数sigma_1 = 2 * epsilon, epsilon = 0.3% * 模型的bounding box的对角线长度。&lt;br /&gt;1.求出每一个顶点的mean curvature，这些标量值是不变的了。2. 求出每一个顶点在sigma_1下的gaussion-weighted average mean curvature，G(vi, sigma_1)。这个公式详细请看论文。其中有个注意的地方是，使用都了当前顶点两倍sigma_1距离之内的邻居顶点。然后再求出G(vi, 2*sigma_1)。3。 求出每一个顶点的saliency值，saliency(vi) = abs(G(vi, sigma_1) - G(vi, 2*sigma_1)).&lt;br /&gt;将上面的过程重复5次，也就是scale 1, scale 2, scale 3, scale 4 , scale 5这论文中所谓的multi-scales。其中，scale 2时，sigma_2 = 3 * epsion; scale 3: sigma_3 = 4 * epsilon; scale 4: sigma_4 = 5 * epsilon.&lt;br /&gt;最后一步是将每一个顶带你在5个scales下的saliency值做非线性的求和。具体公式也请看论文。&lt;br /&gt;&lt;/div&gt;&lt;div&gt;应用&lt;br /&gt;其中一个应用就是改进Quadric error metric （QEM）简化算法。在每一个顶点的quadrc上乘以自己的saliency值，当然了这个saliency值已经过放大的。这其中体现了：saliency值大的顶点，更能表现重要性，应该在更后面被收缩。这和quadric(vi)值大的顶点推后被收缩是一致的。&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-8682033814568142079?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/8682033814568142079/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2007/11/saliency-siggraph2005.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8682033814568142079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/8682033814568142079'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2007/11/saliency-siggraph2005.html' title='&amp;quot;Mean Saliency&amp;quot;, siggraph2005的论文'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_v1BqZujzE0E/SbUrTQFUcYI/AAAAAAAAACQ/8vnPHhW1pMM/s72-c/saliency.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-7811546108710235851</id><published>2007-11-09T23:32:00.002+08:00</published><updated>2009-04-14T22:34:45.381+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='laplacian'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Laplacian Operators</title><content type='html'>一般遇到的laplacian operators有两个：&lt;br /&gt;(1).[Taubin 95] "A Signal Processing Approach to Fair Surfac Design"中提出的Uniform Laplacian, also known as Tuttle Laplacian.使用的就是uniform weighted,将邻域顶点的坐标加和再平均。这是最简单的拉普拉斯算子。&lt;br /&gt;(2) [Desbrun 99] "implicit fairing of irregular meshes using diffusion and curvature flow"中提出的Cotangent Laplacian. 使用的正是常说的Cotangent weight.&lt;br /&gt;&lt;br /&gt;Laplacian Coordinate将一个laplacian operator应用到一个vertex就获得这个vertex的laplacian coordiante(这是一个向量),而这个laplacian operator的系数, 也就是the so-called laplacian coefficients.我的感觉是：某个vertex上的laplacian值反映了这个顶点于其邻域(neighborhood vertices)的关系。PS. 所谓的邻域，常见的为一个顶点的one-ring neigborhood.&lt;br /&gt;&lt;br /&gt;我所come across的应用：&lt;br /&gt;(1)利用Cotangent weight求Discrete Mean Curvature Normal of a vertex(这也是一个向量值)。H(vi) = (1/Area(vi) * [laplacian coordinate(vi)]；其的大小(标量值)就是某个顶点的mean curvature.这好像是反应了mesh model的固有特征。通过求解model中的顶点mean curvature值，可以直观的看到这个model的光顺性(这是我以为的,现不知对否）。在许多论文中，提到Laplacian operator的时候都常提到Mean Curvature.&lt;br /&gt;(2)Laplacian smoothing常说的平滑smoothing可能包括了denoise and fairing两种。我暂时取狭义的denoise为smoothing。Laplacian smoothing：the classical Laplacian smoothing, where every new vertex of the meshis moved to the barycenter of its neighbors.vertex_new_position(vi) = vertex_old_position(vi) + laplacian_normal(vi);&lt;br /&gt;(3)laplacian surface editting[O.Sorkine 2004].其实我正是看此paper的时候才开始认真查阅laplacian的信息的。当中拟合surface editting前后的laplacian coordiante of vertices来达到目的。可惜自己理解不够。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-7811546108710235851?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/7811546108710235851/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2007/11/laplacian-operators.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7811546108710235851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/7811546108710235851'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2007/11/laplacian-operators.html' title='Laplacian Operators'/><author><name>任灿江</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4842848464089703396.post-3256304856442018398</id><published>2007-09-24T21:45:00.001+08:00</published><updated>2009-04-14T22:34:58.633+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='simplification'/><category scheme='http://www.blogger.com/atom/ns#' term='Mesh processing'/><title type='text'>Progressive Mesh</title><content type='html'>刚完成了使用了OpenMesh library完成了Progressive Mesh的写出，明天要完成对其的重新读入。&lt;br /&gt;有兴趣的可以讨论一下。&lt;br /&gt;---------------------------------------&lt;br /&gt;2007-11-12&lt;br /&gt;Hoppe论文中是使用最小化energy来简化mesh的，而我很惭愧地至今没有对mesh上energy的conception有清晰的理解，所以我是通过QEM算法来简化得到PM结构的。&lt;br /&gt;但是我还希望能做到在PM结构上进行任意点的truely select refinement。在2001年的一paper"Truly selective refinement Of Progressive Meshes"中，似乎证明了对任意点的selective refine是可以进行的。当中引入了两个concept，dual piece of a vertex 以及 cut vertex of Vs。从中，我对QEM中的edge contract简化过程有个一个新的理解，整个simplification process中，其实就是mesh中某些三角形的扩张过程！扩张的结果？:-) think about it yourself&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4842848464089703396-3256304856442018398?l=rencanjiang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rencanjiang.blogspot.com/feeds/3256304856442018398/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://rencanjiang.blogspot.com/2009/04/progressive-mesh.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3256304856442018398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4842848464089703396/posts/default/3256304856442018398'/><link rel='alternate' type='text/html' href='http://rencanjiang.blogspot.com/2009/04/progressive-mesh.html' title='Progressive Mesh'/><author><name>cj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_3ksWOBRDci4/SeSgxZWch9I/AAAAAAAAABQ/DmdIWgosRQA/S220/14022009955.jpg'/></author><thr:total>0</thr:total></entry></feed>
