因為我的項目需要,最近開始接觸物理引擎(Physics Engine)。在這之前,我對物理引擎可謂一無所知,不是把公式都輸入進去,讓電腦計就行了嗎?而基本上物理引擎亦就是一個物理模擬演算的程式,只是它的設計往往可以很複雜,一方面需要注意演算方法的效能,另一方面要解決和權衡物理規律的準確性和多元性,譬如一般Flash遊戲所用的物理引擎和天文台預測氣象用的物理引擎兩者考慮的物理規律、準確性和速度要求差距甚遠,所以它也發展成實時性(遊戲用)和高準確性(科學用)兩個主流,並在精準度和運算速度兩者間作不同的平衡。
由於和現實世界有差別,在數位模擬可能會出現一些不同現象:例如一個乒乓球正飛向一塊牆,正常的的情況下乒乓球會碰到牆,然後反彈;但若果乒乓球以極高速飛行,它在數位世界的緊接的時刻便會有很大的位置跳動,它便可能在跳動的一下子穿過那塊牆,沒有發生碰撞並繼續前進。所以,為了防止錯誤,物體的大小和速度都可能需要有上下限制,或加入其他的約束。
物理引擎主要為硬物體、軟物體和流體的運動提供模擬演算,演算的模式或方法有許多,若要了解引擎的設計,當中涉及很多物理、數學和編程的背景知識,非門外漢能一時三刻理解,我想這也是相關工具和人手稀少珍貴的原因吧,但是這個情況將隨著更多開放原代碼的物理引擎出現和編程知識的普及而改變。
我主要接觸的引擎是從近年流行於在Flash和iphone遊戲中使用的Box2D。在Box2D的世界裡,除了有個綜合器(Integrator)去模擬不同的時刻外,還有個約束處理器(constraint solver)來解決多個物體在速度和位置間的的衝突,來避免物件重疊和關節脫掉。
(待續)
28.4.10
17.4.10
HKIE(IT Division) Annual Conference and Dinner 2010
As an undergraduate, by no means I would be able to attend such a professional conference and gathering, not to mention that I am not even a member of The Hong Kong Institution of Engineers(HKIE). Yet, the world is full of wonders. I am lucky enough to have a peek of the event.
The story should begin with my participation of the British Computer Society(BCS) Mentorship Programme. Fortunately, I am assigned to be the mentee of Ir. Michael Leung, an active HKIE committee member. He is outstandingly sociable and is willing to develop the young. He invited me to help in this event and, more importantly, to broaden my horizon.
The event is divided into three parts, industrial visits, annual conference and annual dinner. I have participated in all three parts and will share some of my insights.
HKIE invited delegates of different professional fields from Shenzhen to join the event, where the industrial visits were explicitly prepared to enrich their visit. A few of them, especially those from the China Association For Science and Technology(中国科学技术协会), showed a strong attitude for bridging the mutual technological development between Hong Kong and Shenzhen throughout the event. They were impressive to me.
After the visit and the conference, it is getting more obvious to me that the departments of the mainland government are more unified and authoritative than those in Hong Kong. The visit of the Transport Department(TD) of HKSAR let me know that the TD only cares about the roads and traffic but not about car accidents, whereas the TDs in mainland care both. This really makes a difference on how and what to install for the road surveillance cameras.
The structural differnce of the governments is an obstacle for the information exchange and cooperation. For example, the Shenzhen government uses GPS/AGPS locations of taxis to monitor the traffic of the region. Such method is not yet quite feasible in Hong Kong as the GPS channel is owned by private company and the privacy of the car locations would need to be protected. The proposal of joint region traffic monitoring and planning would be much harder for Hong Kong to adopt than other cities in the mainland. Privacy comes at a price.
After watching the presentations from the HKSAR officials, I would suggest the government to give some publicity and language training to our civil servants, because some, but not all, looked inferior to the those from the mainland, the business sector and the academic sector. I suppose the difference comes from their attitude towards stability, instead of change for improvement.
On the contrary, the presentation from HSBC was professional and excellent. It was remarkable that the original speaker had to attend an emergency announcement and the assistant was ordered to give the presentation a night before, demostrating high adaptability. A deep and wide customer-centered service vision of HSBC was described and was impressive to me. It seems to me that they have also passed most of their values to their employees as some ideas are consistant to what I have heard from my friend who has completed a placement in HSBC. The slides were prepared by the assistant himself for his routine. He told me that the average production time for the presentation was 2 hours per slide.
It is not difficult to realize that many engineers who went to the annual dinner were partners in the field. Most of them went to gatherings of different institutions to form new connections and strengthen the old ones. The active ones would become committee and shift positions within different related institutions and it looks like the same group of people playing around the field.
The people who toasted here and there usually had high positions in the profession or their organizations. Social power brings authoritative position and it can go backward, as they are mutual. Such relation is more obvious than the high table dinner I experienced in school, as I find myself being invited to be a helper in another annual dinner. It is wise to be actively socializing in this environment.
Time will pass. Names and positions will change. We share and cooperate because we wanted to achieve more within our limited time.
7.4.10
團隊活動日程工具推介:Doodle
以往我們要辦團隊活動,例如開會和吃飯,為了安排日期和時間,都要由一個負責人通過電話或電郵去收集所有參加者的空餘時間,然後從一大堆時間表中找出一個共同的空間,再發回給所有人。若果人數愈多的話,整個過程就愈教人費神,收集和處理資料的時間也愈需要得多。
當我在網上尋求更好的解決辦法時,先發現Scheduleonce,再發現Doodle。Scheduleonce雖然介紹得比較詳細和感覺上程式寫得比較專業和多功能,但它對從來未接觸過電子日程的人來說是相當複雜的。為免參加者摸不著頭腦,介面比較簡潔的Doodle則更派上用場。(想當初我還被它簡陋的樣子嚇到呢!)
Scheduleonce
Doodle
負責人和參加者都毋須登記便可以立即免費使用Doodle,而且它的用法都相當簡單:負責人只需要輸入活動標題、自己的名稱,選擇幾個可行的活動日期(或時間),便可以建造出這個活動專屬的投票網頁,然後把網址寄給所有參加者便可以等待回應結果;而參加者只需要在能夠出席的時間上打勾、輸入姓名和確認;等足夠回應後,結果一目了然,負責人再宣布結果便成。
相比以往,這方法有效地節省了負責人收集回應和校對時間表的精力,並且增加了透明度。當我開始利用Doodle和幾個團隊安排會議時,感覺比以前更有效率和更樂意承擔這項工序。另外,他們也覺得這工具相當方便快捷,並開始向其他朋友和團隊介紹和採用。
當我在網上尋求更好的解決辦法時,先發現Scheduleonce,再發現Doodle。Scheduleonce雖然介紹得比較詳細和感覺上程式寫得比較專業和多功能,但它對從來未接觸過電子日程的人來說是相當複雜的。為免參加者摸不著頭腦,介面比較簡潔的Doodle則更派上用場。(想當初我還被它簡陋的樣子嚇到呢!)
Scheduleonce
Doodle
負責人和參加者都毋須登記便可以立即免費使用Doodle,而且它的用法都相當簡單:負責人只需要輸入活動標題、自己的名稱,選擇幾個可行的活動日期(或時間),便可以建造出這個活動專屬的投票網頁,然後把網址寄給所有參加者便可以等待回應結果;而參加者只需要在能夠出席的時間上打勾、輸入姓名和確認;等足夠回應後,結果一目了然,負責人再宣布結果便成。
相比以往,這方法有效地節省了負責人收集回應和校對時間表的精力,並且增加了透明度。當我開始利用Doodle和幾個團隊安排會議時,感覺比以前更有效率和更樂意承擔這項工序。另外,他們也覺得這工具相當方便快捷,並開始向其他朋友和團隊介紹和採用。
訂閱:
文章 (Atom)