Uncategorized

  • New Logo

    Same old logo, just make it 3D.
    Click image for larger version.
    3D Logo

    6000 samples, rendered for 4.5 hours.

    Huge glass piece plus multiple lights (4 in the scene) make a hard time for Cycles. Even with 6000 samples, you can still see noise (small light spot) in the full size version.

  • CG – 20111231

    A late update.

    First try on fluid simulation. The fluid simulator is very hard to use, given that the accuracy is not high enough. For a still image, each droplet must be manually adjusted; otherwise, the droplets will go halfway through the walls.

    Most of the time was used to edit the water. I didn’t pay much attention to the bathtub, and I think it is too reflective and too smooth. Luckily it is blocked by vapour.

    (Click image for larger version.)
    Shampoo

    4000 samples, 8 hours rendering time.

  • CG – 20111219

    Cycles is official. So, what is the best way to celebrate? Use it.

    This is my first scene with Cycles, second render.

    This is also my first try on texture in Blender (which turns out pretty bad)…

    (Click image for large version.)
    Chess_2

    For this render, I mistakenly turned off the “caustics” option. This makes the glass piece lack the “shininess”, and look more like plastic.

    Made with Blender 2.6.1, rendered with Cycles.
    3000 samples. 5-something hours of render time.

  • First (Programming) Language

    Using C++ as a teaching language is a very dumb idea.

    Programming is about all the programming concepts. Languages implement those concepts. Which language you use doesn’t matter, as you are using the same way of thinking[1], expressing the same concepts.

    While this is true for programming, learning programming is whole another thing. When you don’t have the concepts, simultaneously learning the specific language syntax will distract you. That’s why things like loop and conditional are usually taught without mentioning syntax at first. Learning semantics and syntax at the same time is hard. With C++’s complex and cryptic syntax, the distraction is so big to the point where some students never understand the programming concepts.

    Take the for loop for example. In C++, the syntax of a for loop is:
    for (initialization; condition; action-to-counter)
    An example is :
    for (int = 0; i < 10; i++)
    You can omit any one of those. In fact, you can omit all of them. Therefore, the following is a valid statement in C++:
    for (;;)
    This is a way to achieve an infinite loop in C++. The problem is, this obscure the line between for loop and while loop. Yes, this is a valid command, but it does not convey the concept well. Compare to the usual pseudo-code:
    for i in 1 to 10
    one can really see the syntax from Python:
    for i in range (10)
    and the one from Ada:
    for i in 1 .. 10
    is clearly superior, and the C++ one is really cryptic. C++ is too close to the metal; the high-level programming concepts is behind too many abstractions, or rather, details of the underlying hardware. Some may argue that it is this thing that distinguish brilliant programmers from the mediocre, but I say that this undermines so much brilliance.

    Actually, this syntax of for loop comes from C, and I condemn every language that copies it. This includes but is not limit to C++, C#, Java, JavaScript, and PHP. For a programmer, learning a new syntax of a different language is a matter of minutes, if not seconds. But, for a newcomer, learning the concept of for loop from this syntax can be a painful process.

    Using C++ to teach programming is a very dumb idea, especially when teaching someone who has never learnt programming before.

    Pedantic footnote:

    [1] With some variation. due to the characteristics and limitations of different languages, you may or may not convey some ideas or concepts in a language.

  • Why Now?

    “Why do I need to reed the book about programming now? How much will be taught in a lecture session? Less than a chapter? Then I have time. There is no need to hurry.”

    After hearing this, I felt very in danger as a group-mate.

    Programming is not something you can simply read and do. Programming is abstract; there are things that you need to remember, think, and practice. This is more true considering we are learning C++.

    When I first learnt pointers (and reference, simultaneously, which is a pretty bad learning plan), I had a really hard time understanding what was going on in the code. It just didn’t make sense to me. For the next two years I didn’t even touch programming, let alone C++ and pointers. But when I re-learnt pointers later, suddenly I could understand the code.

    Even if you’re not thinking about it, your brain continuously reorganises things you have learnt. You just have to give your brain some time to digest.

    If you think you are going to learn programming sometime in your life, you had better read something about it now.

  • What?

    昨日去學琴的路上……當我過了一條馬路,轉右再走之際,我看見一名女子跌倒在路上。

    她從行人路上倒後跌到馬路。她手腳沒有反應,像冬瓜一樣滾至背部着地。正常人跌倒之時,四肢理應會嘗試重拾平衡,最少也會伸出雙手,以減低身體所受撞擊。但她沒有。若她的手腳有任何動作的話,那是往身體屈曲--與正常人完全相反的動作。

    我第一樣想到的,是痙攣。我走到她附近,看看到底時什麼事。眼望前面不到十米處有輛停下的客貨車,心想這行車線尚算安全,左手已在褲袋準備取出電話報警。

    她躺在地上不動後,粉紅色的電話因慣性而飛到地上。正當我以為電話是從手提袋掉出,她拿起電話,一聲「喂?」,然後站起身,回到行人路上。

    我心中湧現一句粗口。

  • 一周年

    一年前,二零一零年九月五日,Project α 第一至三章首次現身於本網誌。經過四個月努力,Project α 突破二萬五千字,成為我最長的一篇作品。往後四個月,我因要應付高考而暫停寫作。今年五月,在高考完結一個月後,第六章成功上載,本應標誌 Project α 的工作再度展開,可是……現在已九月,第七章仍未見踨影。

    並非 Project α 已遭遺棄,純粹最近有幾項新項目想試行。因為沒有確實時間表,所以舊項目就自然荒廢了。

    現在沒有什麼新項目想試作。趁着這紀念性的日子,該要重新執筆了。

  • Deadline

    二零一一年九月一日已過去。距離我人生最長假期的終結,尚餘幾日。

    還有人記得兩年前的延期嗎?好消息,那又要再延期了。因為失去開發平台,八月中至今的工作進度是零。

    話雖如此,縱使開發未停,亦不代表我能拿什麼出來。始終,一個簡單的圖形引擎已耗用我將近三個月。況且,遊戲引擎的其他部份我完全未着手,我甚至連要如何入手也未知。

    所以,這個已延期兩年的計劃,將再度延期。這次會是無限期延後。我要學 Blizzard 同 Valve。

    與此同時,我在想,是否有些比較簡單的作業可以先行完成。於是,以下的計劃就誕生了。

    這個計劃,至今仍未名命。雖然已經完成原型,但亦只有零零五的開發編號。

    遊戲中,有兩名玩家,儘管叫他們做 escaper 和 hunter。Escaper 的工作,顧名思義,就是要逃離 hunter 的追捕。如何?用遊戲中的「轉盤」機制。

    轉盤上有一個數字,在一至二十之間。當 escaper 轉盤上的數字和 hunter 的相同,escaper 就需要丢棄自已的轉盤。當 escaper 失去全部五個轉盤,就會被 hunter 捉到。如果escaper 能撐過十個回合,就能成功逃脫。

    每一回合,每個轉盤都有一次轉動的機會。數字最多可以加減五個單位;改變可以是零,即維持現有的數字。叫做轉盤,係因為數字是循環的:當轉盤在二十,若然加一,轉盤會「轉」回一。

    回合開始時,會顯示雙方所有的轉盤,然後先由 escaper 改變數字。後由 hunter 改。這時候,hunter 並不會知道 escaper 如何改變轉盤數字。回合結束時,就會對比雙方的轉盤,如果數字相同,escaper 就會失去轉盤。Hunter 一個轉盤只能消去 escaper 一個轉盤。

    Escaper 也有反擊的機會:使用特殊的第六個轉盤 trap。如果 trap 的數字與 hunter 的轉盤一樣,hunter 就會失去該轉盤。當 hunter 失去全部三個轉盤,就沒有能力再追捕 escaper。那麼,就算回合數未耗盡,escaper 也會勝出。Trap 與一般轉盤的分別還在於,trap 於每回合只能轉動一個單位。

    參數:

    Escaper 轉盤:五個,加一個陷阱

    Hunter 轉盤:三個

    轉盤大小:二十

    轉盤轉動能力:五 (每回合最多加減五)

    陷阱轉動能力:一

    總回合數:十

    參數極有可能極不公平,因為遊戲未經測試,實在不太可能平衡。往後若有機會測試 (或有有心人替我測試) 時再談。

    遊戲可以加入不同的模式,例如改變轉盤的大小或範圍,如十至二十,或負三至十四,可以再加入轉動轉盤的時限,超過時限就不能轉動該轉盤。又或者可以將 trap 放到一般轉盤中間,而其位置則只有 escaper 知道。當然,trap 的轉動能力明顯少於一般轉盤;要如何不令別人知道哪個是 trap,這就考 escaper 的功夫了。

    遊戲機制就這樣。什麼美化、音效、故事、諸如此類,日後再談,現在這只是個十分簡單的文字介面遊戲。