转到正文

There are some confusions about the Microsoft's DirectX10 SDK document about D3DXVec3TransformNormal.

The correct meaning of "D3DXVec3TransformNormal" is that "D3DXVec3TransformNormal transforms a normal using the transpose of the inverse of the given matrix". However, the DirectX SDK says: "If you want to transform a normal, the matrix you pass to this function should be the transpose of the inverse of the matrix you would use to transform a point.". The SDK document means that you should inverse your input matrix and then transpose it manually and then give it as parameter to the function "D3DXVec3TransformNormal". But as a matter of fact, you just have to input the transformation matix, and DirectX would do inversion/transpotion for you.

There are some details as follows for the function of "D3DXVec3TransformNormal" if you want to know:

Normals are different than vertex positions in that they always have their origin at 0,0,0 (i.e. they don't have a position) and they shouldn't be scaled or skewed.

For this reason, when transforming normals:

1. You shouldn't apply any translation.
继续阅读

我期待

13
337 views  |  等待

我期待有一天我会回来
回到我最初的爱回到童贞的神采
我期待有一天我会明白
明白人世的至爱明白原始的情怀
我情愿分合的无奈能换来春夜的天籁
我情愿现在与未来能充满秋凉的爽快
say goodbye say goodbye
前前后后迂迂回回地试探
say goodbye say goodbye
昂首阔步不留一丝遗憾

我情愿分合的无奈能换来春夜的天籁
我情愿现在与未来能充满秋凉的爽快
say goodbye say goodbye
前前后后迂迂回回地试探
say goodbye say goodbye
昂首阔步不留一丝遗憾
say goodbye say goodbye
前前后后迂迂回回地试探
say goodbye (合)say goodbye
昂首阔步不留一丝遗憾

继续阅读

Careless Whisper

11
340 views  |  等待

生活好平静,现在。实验室,Coding,操场,跑步,体育馆,健身,食堂,吃饭,宿舍,睡觉。与以前一样,白天和师弟们聊聊生活,说说未来,哪里来的八卦小道消息。每当下午跑完步后坐在双杠上时,我总会对着夕阳说,啊,我喜欢这样的生活,吹着风,看着晚霞。也许我已经适应了这种生活,接触新事物变得迟钝,也变得不想去接受他们。和小妹聊了很多,和师兄聊了很多,我很清楚自己要干什么,自己要成为什么样的人,自己想要什么样的生活,自己喜欢什么,不喜欢什么,也很清楚自己任何困难也可以克服,就像长跑过程中自己为自已喊加油一样。但是,任何清楚的东西在现实面前又会很模糊,很不确定,而导致彷徨,不知所措。

我很相信命运的说法,因为无形之中似乎有人在指引着我走向某个地方。这个世界只有她才知道未来,除了她所有人也不知道。生命很刺激,因为充满着那么多地不确定。因此,我常思索着人生,但是没有得到任何结果,就像某人所说的那样,不要过度去追求人生的意义,也许,存在就是合理吧。

小师姐今天投了论文了,从明天开始就轮到我了。可能需要二个礼拜的时间吧。辛苦点吧,没问题,我常会对自己说。不就是2个礼拜的长跑嘛,不用想什么,撑到最后就赢了。这次写完论文就好想回家了,自己有点累了,听着伤心的歌,总会让自己的心情变得好差,但不知道为什么,自己还是会灯蛾扑似的沉迷下去 <careless whsper>:

careless whisper

time can never mend
the careless whispers of a good friend
to the heart and mind, ignorance is kind
there's no comfort in the truth
pain is all you'll find
should've known better
继续阅读

XML Parser methods for C++

11
763 views  |  C++

About one month ago, I implement a simple xml parser for C++ project. In this project, I use C++ to call C#, and use C# to read XML. The calling between C++ and C# is the importance of my project. It's well known that C# use managed memory, so I have to use some trick(COM technique) to finish the calling from C++ to C#.  For more detail, you can reference link[1][2].

There is another method to implement XML parser of C++. It's well known that there are many open source XML parser Library[4]. A well-known library is Xerces[5].  These parsers are very powful, in other hand, they are more complex. If your project use XML very often and want to read/write XML, you can use these libraries. However, if you just want to read some configure task or some tasks that C# can do, I think it's more easy to use C++-C# Adapter.

继续阅读

When you use Visual Studio on Windows 7 or Vista, you encounter "access denied. Please make sure you're running the application as administrator" error if you want to do some administrator's tasks.

There are two solutions:

  • turn off the UAC of your Operating System
  • run visual studio as administrator.
    There is good trick for runing VS always as Administrator[1].

Reference:

[1]. http://weblogs.asp.net/soever/archive/2009/10/07/visual-studio-alway-run-as-administrator.aspx

Today I update my CsharpCOMCplusAdapter project to be the version 2.0. In this version, we still can use c++ to call C#(version 1.0's feature[1]), moreover, we can not only use this project in your 32-bit program but also 64-bit program.

Some Problem:

These days I want to transfer my program from 32-bit version to 64-bit version. So I install Windows-7 64-bit opertaion, and set up 8GB memories in my computer. Why I want 64-bit program? That's because 64-bit program can visit large memory address. It's well know that 32-bit program can only visit 2GB memory in 32-bit OS and 2GB memory + 2GB virtual memory in 64-bit OS[2]. However, my program want to read memory as more as possible. Moreover, my program can not read virtual memory ( this is because my program use SuperLu library and this library can not swap memory out of disk). So, if I build my project to be 32-bit program, no matter it runs in 32-bit OS or 64-bit OS, it always can only read 2GB memory at most. However, my program often collapses because memory not enough problem.

Solved:

继续阅读

Body test

11
312 views  |  It's My Life

A funny website for your weight and height: http://www.hao123.com/haoserver/standard.htm

The following picture is my body's result~ I have to gain weight to be 68 kilogram. Sports! Sports!

[转]暗恋帝

9
602 views  |  杂谈

转自ZJU's BBS. 关于暗恋的故事。

悲剧是昨天晚上发生的,我不知道昨晚是几点睡着的,睡着的时候天已经大亮了,刚刚从床上爬起来,那股令人窒息的烦躁和悲伤又让我不知所措,我真的不知道我该干些什么才能让我忘了她让我忘了这段注定是悲剧的感情。我现在想做的就是把这一切完完整整的写出来,把我这一年半多挥霍掉的时光回忆起来,就像我昨天和她说过的那句话,就算是死,也要让我死个明白。

一切都是从08年的秋天开始的,那时我们刚上大二。我第一次看见她是在潘正权的大学物理2的课堂上,在西1-105那个教室。我记不太清是什么时候开始注意到她的,好像有一次上课坐在她的旁边吧,当时就觉得这个小女生干干净净漂漂亮亮的让人看上一眼就忍不住喜欢。之后我就开始喜欢上大学物理课,喜欢每节课坐在后面偷偷的看看她,我当时根本没想过要和她发生些什么,只是觉得看见她在那里安安静静的坐着,我就会很安心,谁又知道呢,接下来的一年多里我每天所有的期待就是这份安心……

开始的时候我不知道她叫什么名字,不知道她是什么专业,因为毕竟是大学物理么,鬼知道大家都是哪个学院的,秋学期就这么浑浑噩噩的过来了。直到冬学期,我在一门我们的专业课上也看到了她,我就觉得好巧好开心,我就问一个关系很好的女生,这里叫她果果吧,那个坐在第一排靠右边穿灰色衣服的女生是谁啊,她说是谁谁谁是我们学院学生会的主席。我一下就被雷了,哇塞,学生会主席竟然可以是一个这么文静的小女生。我就觉得很神奇,就对她越来越感兴趣。先说一下果果吧,她是我大学里关系最好的女生了,在整个过程中她一直在尽全力帮我,我悲剧了她也会来安慰我陪在外面走好久,不管结局怎么样,我真的很感激她。

继续阅读

www.liaoqiqi.com网站PR查询 博客简洁版 博客Google_Site_Map 博客Baidu_Site_Map ?