Friday, November 27, 2009
Make yourself think
http://projectgroupthink.wordpress.com/
Then I read this about the 10 movies that make you think. I must say, I love it!
These are some of the movies that I had watched, plan to watch again. So enjoy.
http://projectgroupthink.wordpress.com/2009/05/28/10-movies-that-make-you-think/
Thursday, November 26, 2009
Yay? No?
I found this absolutely great site from Today (Singapore's free tabloid, right?) that talks about music and concerts. Yay. And by the way, next year is going to be a great year for concert lovers because a lot of good acts' coming to Singapore.
http://blogs.todayonline.com/poparazzi/
I've got my tickets for Green Day and Muse. Aarrgh. So many concerts, so little money!
Monday, November 23, 2009
Parametric Curves
Geometric Continuity
* G0: curves are joined
* G1: first derivatives are proportional at the join point
The curve tangents thus have the same direction, but not necessarily the same magnitude. i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
* G2: first and second derivatives are proportional at join point
Parametric Continuity
* C0: curves are joined, There may be a sharp point where they meet.
* C1: first derivatives equal, The curves have identical tangents at the breakpoint. (The tangent is the slope at the breakpoint.) The curves join smoothly. C1 curves also have positional continuity.
* C2: first and second derivatives are equal,
The curves have identical curvature at the breakpoint. (Curvature is defined as the rate of change of the tangents.) Curvature continuity implies both tangential and positional continuity.
If t is taken to be time, this implies that the acceleration is continuous.
* Cn: nth derivatives are equal
Thursday, November 19, 2009
Semester 3: Them
Prof Normal
I guess, he's by far the most normal. Articulate, logical and well behaved. He's not fully research only when he says, "Resolution is just as important to determine the feasibility of the method proposed."
And really smart. He knows sometimes we don't really know what we're saying but he has never tried to embarrass us during our presentations. Cares about teaching, you just can tell. Great prof.
Oh ya, and he wears converse canvas and printed shirts. Score!
I'm hoping to do my dissertation with him.
Game
Prof Huh
Absent-minded. Funny. Knows a lot. He's a tenured professor. Thinks everything is extremely easy. Explains well. But just so busy he becomes forgetful.
Tuesday, November 3, 2009
GLUI Quick Guide from CodeProject
I found this GLUI guide easy to use and refer to.
http://www.codeproject.com/KB/openGL/GLUI_Window_Template.aspx#6-AddGUIControls17
Sunday, November 1, 2009
A Few Tips on How to Use PowerPoint for Mathematical Presentations
I've included this tip from the link at the bottom of the post to help me with the equations in PowerPoint.. This is not my own post.
What These Are About
These tips may help you produce math-heavy PowerPoint presentations more efficiently, and get them to look better. They assume familiarity with the basics of PowerPoint. They do not argue for or against using PowerPoint for your presentations (there are many pros and cons). They were born out of a conversation among graduate students in the MIT theory group sometime in 1999 or 2000, when many of us were discovering PowerPoint and agreed that a page for sharing tips would be useful. Some of them are probably getting out of date as newer versions of PowerPoint come out.They are maintained by Leonid Reyzin. Please contact me if you have additional tips you think should be included, or if you find something wrong (or no longer applicable).
Machine Independence
One of the biggest headaches with PowerPoint is the difficulty of getting it to look the same on different machines. To that end:- Make sure your file includes fonts. This is accomplished by going to the "File" menu, selecting "Save As," and checking the "Embed TrueType" check box in the dialog box that pops up. Then click "Save." Your file will likely become very large once you do this, and you may need to compress it to get it to fit a single floppy (see also "Miscellaneous PowerPoint Tips," below, for how to deal with large files).
- If you use Equation Editor/MathType, you need to embed those fonts, as well. Unfortunately, PowerPoint doesn't know you are using those fonts simply because an equation is embedded (it treats equations as graphics); thus, you need to make sure that at least one character from each font used in your equations appears somewhere (e.g., on a special slide, or as white on white, or just a space) in an ordinary PowerPoint textbox. The fonts you are interested in are MTExtra, Euclid Math One and Euclid Math Two. Then use "Embed TrueType" option described above. (Thanks to Bob Mathews for the tip.)
Making Overlays
Get everything you want onto one slide, and get in its final form. Then split it into overlays as follows: copy it as many times as the number of overlays, and simply "hide" parts on each slide. To hide a part, change its color to white, or cover it up with a white rectangle. Do not delete text, because that will move other text around, and your overlays won't match. Instead, change its color to white.Typesetting Math
One way to typeset mathematical formulas and symbols in PowerPoint is to use TexPoint add-in. I haven't tried it myself, but have heard good things about it. Just save often, because PowerPoint's tendency to crash apparently only increases when the add-in is used (in particular, when the LaTeX interpreter is closed improperly).If you prefer to use "straight" PowerPoint, here are some tips.
- Getting it to look good
- Italicize only what should be italicized. Generally, this means only Roman and Greek variable names (italicizing uppercase Greek is optional). Be sure to not italicize plus and minus signs, function like log and cos, numerals, parentheses, etc. If in doubt about what should be italicized in a particular formula, typeset it in LaTeX and then mimic LaTeX's output in PowerPoint. To toggle italics, just use Ctrl-i.
- Use Times New Roman or a similar font. Sans serif fonts, such as Helvetica, are not good for math (although they may be good for the rest of your presentation). It's ok to have one font for math and another for the text (the slides class of LaTeX does that, in fact). To change fonts without using the mouse, use Ctrl-Shift-f and arrow keys.
- You can also change fonts and styles by using the "format painter" button: simply get one character to look right, and then use the format painter to copy its format to other similar characters. (Thanks to Shane Scott for this tip.)
- Do not use a hyphen for a minus sign. A much better minus sign is an en-dash. Unfortunately, it is a bit hard to get in PowerPoint. See "Inserting non-standard characters" below.
- When you copy math around, make sure it has the same font size as the surrounding text. PowerPoint will not always automatically get it right.
- Inserting non-standard characters.
- To insert Greek letters, simply type the "corresponding" Roman letter (e.g., "a" for alpha, "t" for tau, "q" for theta), and then change its font to Symbol. Same for "sum" and "product" symbols: simply use capital sigma and capital pi.
- Standart Unicode symbols for integrals don't look any good. You may want to use the curve-line tool to make one and then copy it around. (Thanks to Nikola Venkov for this tip.)
- To insert the many special symbols that are available in Microsoft Word (such as en- and em-dashes, ©, etc.), simply open up Microsoft Word, and insert them using the menu "Insert" then "Symbol." The "Special Characters" tab is particularly useful, and contains handy keyboard shortcuts. Once you get it in Microsoft Word, simply select it, copy it, and then paste into your PowerPoint text. Make sure the result has the correct font and size. Then you can copy it around your PowerPoint file whenever you need it.
- More recent versions of PowerPoint have the "Symbol..." item in the "Insert" menu (the corresponding toolbar button is available, as well: see "Miscellaneous PowerPoint tips," below). You can insert characters from various fonts.
- A host of characters is available in the "Character Map" accessory. (Go to the "Start" button, then "Applications," then "Accessories," then "Character Map.") Trying different fonts to find what you need; Symbol font is particularly useful for math. You can select and copy characters, then paste over to PowerPoint. Moreover, if you click on a particular character, you get the "keyboard code" for it displayed at the bottom. Once you learn the keyboard code, you can type it directly in PowerPoint without having to copy and paste. For example, the code for an en-dash (which is good for minus signs) in Times New Roman font is Alt-0150 (hold down Alt, press 0150 on the numeric keypad, then let go of Alt). The code may be different in other fonts.
- Subscripts and superscripts
- To make subscripts and superscripts using the menus, select the character you need, then go to "Format" then "Font." Note that you can get double superscripts, subscripts of superscripts, etc., by varying the "offset" amount.
- It is faster to make standard subscripts and superscripts using the keyboard. Ctrl-= toggles the subscript flag, and Ctrl-+ (same as Ctrl-Shift-=) toggles the superscript flag. For example, to get aixi, type "a, Ctrl-=, i, Ctrl-=, x, Ctrl-+, i, Ctrl-+" (don't forget to turn on italics at the beginning by "Ctrl-i").
- You can also get buttons for making subscripts and superscripts on your toolbar. See "Miscellaneous PowerPoint Tips" below. Or you can use the format painter: get a single subscript to look right, and then copy its format to other subscripts (see "Getting it to look good" above).
- More complex formulas.
- You may avoid using Equation Editor/MathType (see "Machine Independence" above) by utilizing multiple text boxes instead. You can move them around to get them in the right positions. Note that large parentheses, brackets, braces, and other useful shapes are available under "AutoShapes" (most likely on your drawing toolbar). Once you get a formula to look right, group all of its components (see "Drawing" below), so you can easily move it around and copy it.
Drawing
- Learn to use "Group," "Ungroup" and "Regroup" in your "Draw" menu (also on your right-click menu). "Regroup" is particularly handy if you need to ungroup to modify something little. You don't have to reselect everything to group it back: simply choose "Regroup."
- To select multiple objects, hold down the Shift key as you click on them with the mouse.
- It is a pain to select text boxes, because when you click inside them, you get to edit text. If that happens, press "escape," and the text box becomes selected. Alternatively, hold down the Shift key as you click. Conversly, if you've selected a text box and now want to edit its text, press "enter."
- It is often easier to nudge objects by selecting them and using arrow keys, rather than by using the mouse.
- Connectors (available under "AutoShapes" on your drawing toolbar) are great when drawing graphs, trees, etc. They can be made to stick to an object, so when you move nodes around, edges adhere to them.
Layout and Design Tips
- You do not have to be stuck with the standard boring slide style. Play around with it by going to the Edit menu, and selecting Master, then Slide Master.
- When giving a talk that will be projected (rather than printed out on transparencies), the color combination that is easiest on the eyes is yellow (or white) on a blue background. (Thanks to Steven Rudich for this tip.)
- To make small caps font style (equivalent to LaTeX's \textsc command), type in all uppercase letters. Then select all the letters you actually want to be in small caps (i.e., not the ones you want to actually be uppercase, such as first letters of sentences), and simply make the font about four points smaller. (Thanks to Amit Sahai for this tip.)
- To start a new line without starting a new paragraph: press "Shift-Enter."
Miscellaneous PowerPoint Tips
- You can customize your toolbars. In particular, it is handy to have buttons for "Format-Subscript," "Format-Superscript," and "Insert-Symbol." Go to the Tools menu, then Customize, then click on the "Commands" tab. Then simply find a command you want by looking at the various categories, and drag it out of the dialog directly onto a toolbar you want. (Thanks to Amit Sahai for this tip.)
- If AutoCorrect annoys you (e.g., you have a variable named "i" and don't want PowerPoint to automatically capitalize it every time), check out the menu "Tools" then "AutoCorrect." If it doesn't annoy you but is just occasionally wrong, you can undo what it just corrected by pressing Ctrl-Z or selecting "Undo" in the "Edit" menu.
- If you file is too large to fit on a single floppy and you need to take it with you, use the "Pack and Go" command in the File menu. Be sure to check the boxes that "Include linked files" and "Embed TrueType fonts" in the dialog boxes that follow. Prepare a large box of floppies, as PowerPoint manages to only enlarge your file as it "compresses" it. However, the packing and restoration procedure is automated, and beats trying to split the file into multiple chunks yourself. Don't forget to label the floppy disks in numerical order; run the application that is included on the first floppy to restore the file to another computer.
http://www.cs.bu.edu/~reyzin/pptips.html
Thursday, October 29, 2009
GLUI with Visual Studio 2008
Get the source from:
http://glui.sourceforge.net/
Here's how:
http://vis.eng.uci.edu/~jkimball/eecs205/glui.html
Tuesday, October 20, 2009
Good resource from CS Dept U of Aukland
and then some:
This has a plethora of graphics beginners to intermediate
http://www.realtimerendering.com/
Sunday, October 18, 2009
Maya: Render from command line
[Rendering]
Render --> Batch Render.
However that involves opening our maya application overnight.
Here's how to render from command line:
go to the directory where the mb/ma file resides.
render <filename>
That is assuming that you've got all your file properties set correctly for rendering.
Easy eh?
More help here: http://www.wonderhowto.com/how-to/video/how-to-render-maya-scenes-from-the-command-line-249001/
Maya: Motion along path
Ah-har! This helps! Basically motion of camera along a certain path.
Phew! Thanks!
http://caad.arch.ethz.ch/info/maya/manual/UserGuide/Animation/KeyframeMoPath/06_animating_motion_paths.doc2.html
Basic animation how to:
http://www.expertrating.com/courseware/mayacourse/MAYA-Animation-Basics-1.asp
Wednesday, October 14, 2009
Monday, October 12, 2009
Thursday, October 8, 2009
Monday, October 5, 2009
Creating mathematical symbols with MS Word
There are four sections to this document
- Before you can use the Equation Editor
- (Very) Basic operation of the Equation Editor
- Shortcut Keys are your very best friend
- Simonds tips on using the equation editor
The other three sections of this document will work only if the Microsoft Equation Editor has been installed on the machine you are using; the Equation Editor comes with Microsoft Office but is not installed under a standard installation. The computers in the Sylvania CRC and Sylvania math classrooms all have the Equation Editor installed. On your home machine you probably will need to load your Microsoft office CD and do a custom install to install the Equation Editor. (It's easier to do than the phrase "custom install" implies. J ) All of the maneuvers described in this section of the document will need to be done at most once.
After installing the Equation Editor, you also want to customize your toolbar so that the Equation Editor button
is easily accessible. (The button is already on the CRC and math classroom machines.)
| The menu shown in Figure 1 was opened by selecting Tools - Customize from the toolbar menu across the top of the screen, then selecting the commands file-tab at the top of the dialogue box, then selecting the insert category on the left side of the box, and finally scrolling down on the right-side of the box until the Equation Editor button was in view. Once you have located the Equation Editor button, left-click and drag the button up to your toolbar menu. | Figure 1: Customizing your Toolbar |
(Very) Basic operation of the Equation Editor
Once your Equation Editor button is in place, all you need to do to open an Equation Box is left-click that button. Upon your click an Equation Box like that shown in Figure 2 will appear as well as the Equation Editor Menu shown in Figure 3. (As a side note I should mention that the Equation Editor Menu has the unfortunate habit of sometimes opening directly on top of the location at which you are typing. L Should this happen, simply left-click and drag the solid strip across the top of the box until the box is out of the way.)
Figure 2: Equation Box | ![]() Figure 3: Equation Editor Menu |
| The Equation Editor Menu can be used to insert both symbols and templates for complicated mathematical expressions. For example, Figure 4 shows what you click to insert the Pi symbol; Figure 5 shows what to click to insert a fraction template. | ![]() Figure 4: Inserting a Pi symbol
|
Once a template has been inserted into your Equation Box, you need to look and see where inside the template the cursor is flashing. You then go ahead and type the information that goes into that location. To move to the next location in the template you press the Tab key. You also press the Tab key to exit the template. When you are done typing in your expression, you left-click anywhere outside of the Equation Box. If you need to edit an existing Equation Box you simply double-click anywhere over the expression contained within the box.
Shortcut Keys are your very best friend
| Mousing all of your math symbols and templates gets real old real fast; thankfully there are shortcut keys that enable you to avoid your mouse in most circumstances. The shortcut keys are found in the Help Menu when you have an Equation Box open. I have copied the most commonly used shortcut keys into figures 6, 7, and 8. | ![]() Figure 6: Shortcut Keys for selected Math Templates |
![]() Figure 7: Shortcut Keys for after the fact symbol Embellishments | ![]() Figure 8: Shortcut keys for selected math symbols |
Simonds tips on using the equation editor
- Always add a full space before and after an equal sign, before and after a plus or minus sign, after a limit sign or integral sign, and before each limit on a definite integral. A full space is created inside an equation box by pressing Ctrl+Shift+Space Bar.
- Always add a half space between a coefficient and a variable and before and after the arrow sign in a limit. A half space is created by pressing Ctrl+Space Bar.
- To line up your equal signs (J ) you need to use the format/align option shown in Figure 9.

Figure 9: Gotta' line up them equal signs!
- You can add text inside an Equation box by selecting Style - Text from the toolbar menu. (See Figure 10.)

Figure 10: Adding text inside an Equation Box
- Sometimes you might want to insert text along with a multistep simplification or other type process. One way to achieve this is with a matrix. For example, the simplification shown in Figure 11 was typed using a matrix with 7 rows and two columns. The style used in the left column was "Math" while the style used in the right column was "Text." I always insert a blank row between every line to avoid crowding - that's why the matrix had seven rows as opposed to four. The appropriate Menu and Dialogue Box are shown in Figures 12 and 13.

Figure 11: Adding text along with mathematics
![]() Figure 12: The Matrix Menu Bar | ![]() Figure 13: The Matrix Dialogue Box |
Finally, you will find below is a keystroke guide for creating the expression
.
- Open an Equation Box
- press Ctrl+t, u
- type in "lim" (don't type the quotes J )
- press Tab
- type in "h"
- press Ctrl+Space Bar
- press Ctrl+k, a
- press Ctrl+Space Bar
- type in "0"
- press Tab
- press Ctrl+Shift+Space Bar
- press Ctrl+f
- press Ctrl+9
- type in "3"
- press Ctrl+shift+Space Bar
- type in "+"
- press Ctrl+shift+Space Bar
- type in "h"
- press Tab
- press Ctrl+h
- type "2"
- press Tab
- press Ctrl+Shift+Space Bar
- type in "-"
- press Ctrl+Shift+Space Bar
- type in "9"
- press Tab
- type in "h"
- press Tab
- click anywhere outside the Equation Box to close the equation box
Thursday, October 1, 2009
Interesting article
http://www.diversitycareers.com/articles/college/07-sumfall/jm_computergraphics.htm
Monday, September 28, 2009
Sunday, September 27, 2009
Career in Game Development Industry - How to get a foot in?
http://www.jenrickblog.co.uk/2009/09/career-development-in-the-video-gaming-sector-what-skills-do-developers-need-to-excel-please-contribute-to-this-research-paper/#more-1552
Another insight from LinkedIn:
From the Art Pipline perspective I'd say the most important skills are zBrush/Mudbox and 3ds Max/Maya. However knowing those programs does not mean a candidate will stand out. They must understand the pipeline and where they fit in. The artist must be capable and willing to learn custom tools outside of their everyday arsenal of off the shelf products. zBrush/Mudbox Artist must be masters of sculpting and then if required retopoing meshes from the ground up. They should not be afraid of mastering the UV procoess using pelt-mapping and 3D painting solutions. Level designers should prove that they can texture and build environments to a certain scale. Character Artists must study and master anatomy. If I'm an environment artist I should want to show a fully realized world that is playable. Tools such as Unreal Engine 3.0 and Cry Engine 2.0 allow for modelers and texture artists to show their assets in a true game environment rather than just showing a turn table with music playing behind it. It's also helpful to understand how to export normal maps and bump maps for games. A healthy understanding of repeating textures and decals is important as well. Environment artists should envision and create massive detailed set pieces with as limited geometry as is possible. Artists should find the most efficient techniques for limiting the amount of polygons in a scene. Character Artists should attempt hair and fur by using opacity mapped textures. These things which are not easily rendered in real-time will stand out to those in the industry.
I hope this is helpful.
Joseph Tresca Sr. Interactive Art Director, 3D Artist, Eyeballistic, Inc.
Tuesday, September 22, 2009
Animation Paper Reading
I've chosen Treuille's Model Reduction of Fluids. Thing is, I am quite taken with his research and work. But ugh... this is a hard paper. For now... And submission is in 2 weeks' time!
See all his work here:
http://www.cs.cmu.edu/~treuille/
Thursday, September 3, 2009
Thursday, August 13, 2009
A graduate school survival guide: "So long, and thanks for the Ph.D.!"
A computer science graduate school survival guide, intended for prospective or novice graduate students. This guide describes what I wish I had known at the start of graduate school but had to learn the hard way instead. It focuses on mental toughness and the skills a graduate student needs. The guide also discusses finding a job after completing the Ph.D. and points to many other related web pages.
"So long, and thanks for the Ph.D.!"
a.k.a.
"Everything I wanted to know about C.S. graduate school
at the beginning but didn't learn until later."
The 4th guide in the Hitchhiker's guide trilogy
(and if that doesn't make sense, you obviously have not read Douglas Adams)
by Ronald T. Azuma
v. 1.08
Original version 1997, last revised January 2003
http://www.cs.unc.edu/~azuma/hitch4.html
Tuesday, August 11, 2009
Wednesday, July 29, 2009
Windows Movie Maker: Superimpose xml
Here's an example found on: http://www.windowsmoviemakers.net/Forums/ShowPost.aspx?PostID=194964&
<title name="PapaJohn Overlay 25" iconid="13">
<param name="InternalName" value="TitleStandard">
<param name="Description" value="Superimpose image 1">
<param name="LogoBitmapFilename" value="Overlay25.png">
<param name="LogoRect" value="0.00 0.00 1.00 1.00">
<paragraph>
<param name="IsOneLine" value="true">
<param name="BoundingRect" value="1.00 1.00 1.00 1.00">
<param name="MaxCharacterCount" value="32">
</paragraph>
</title>
<title name="PapaJohn Overlay 26" iconid="13">
<param name="InternalName" value="TitleStandard">
<param name="Description" value="Superimpose image 2">
<param name="LogoBitmapFilename" value="Overlay26.png">
<param name="LogoRect" value="0.00 0.00 1.00 1.00">
<paragraph>
<param name="IsOneLine" value="true">
<param name="BoundingRect" value="1.00 1.00 1.00 1.00">
<param name="MaxCharacterCount" value="32">
</paragraph>
</title>
<title name="PapaJohn Overlay 27" iconid="13">
<param name="InternalName" value="TitleStandard">
<param name="Description" value="Superimpose image 1">
<param name="LogoBitmapFilename" value="Overlay27.png">
<param name="LogoRect" value="0.00 0.00 1.00 1.00">
<paragraph>
<param name="IsOneLine" value="true">
<param name="BoundingRect" value="1.00 1.00 1.00 1.00">
<param name="MaxCharacterCount" value="32">
</paragraph>
</title>
</titledll>
</titles>
</transitionsandeffects>
Thursday, July 16, 2009
Tuesday, July 14, 2009
Tuesday, June 23, 2009
Simple things like find
Unix find is a pretty tricky but very useful utility that can often fool even experienced UNIX professionals with ten on more years of sysadmins work under the belt. It can enhance functionality of those Unix utilities that does not include tree traversal (BTW GNU grep has -r option for this purpose and can be used on its own to perform tree traversal task: grep -r "search string" /tmp.). There are several versions of find with the main two being POSIX find used in Solaris, AIX, etc and GNU find used in linux. GNU find can be installed on Solaris and AIX and it is actually a strong recommendation as there are some differences; moreover gnu find have additional capabilities that are often useful.
But find can do more then a simple tree traversal available with option -r (or -R) in many Unix utilities. Traversal provided by find can have excluded directory tree branches, can select files or directories using regular expressions, can be limited to specific typed of filesystem, etc. This capability is far above and beyond regular tree traversal of Unix utilities so find is a real Unix utility -- a useful enhancer of functionally of other utilities including both utilities that do not have capability to traverse the directory tree and those which have built-in simple recursive tree traversal
The idea behind find is extremely simple: this is a utility for searching files using the directory information and in this sense it is similar to ls. But it is more powerful then ls as it can provide " a ride" for other utilities and has an idiosyncratic mini-language for specifying queries, the language which probably outlived its usefulness but nobody has courage to replace it with a standard scripting language.
For obscure historical reasons find mini-language is completely different from all other UNIX commands: it has full-word options rather than single-letter options. For example, instead of a typical Unix-style option -f to match filenames (like in tar -xvf mytar.tar) find uses option -name. Also path to search can consist of multiple starting points, for example
find /usr /bin /sbin /opt -name sar # here we exclude non-relevant directories
In general you need to specify the set of starting points for a search through the file system first. The first argument starting with "-" is considered to be a start of "find expression". The latter can have side effects if you specified actions in the expression.
It is very important to understand that you can specify more than one directory as a starting point for the search. To look across the /bin and /var/html directory trees for filenames that contain the pattern *.htm*, you can use the following command:
find /usr /var/html -name "*.htm*" -print Please note that you need quotes for any regex. Otherwise it will be evaluated immediately in the current context by shell.
It is simply impossible to remember all the details of this language unless you construct complex queries each day and that's why this page was created. Along with this page it make sense to consult the list of typical (and not so typical) examples which can be found in in Examples page on this site as well as in the links listed in Webliography. An excellent paper Advanced techniques for using the UNIX find command was written by Bill Zimmerly. I highly recommend to read it and then print and have a reference. Several examples in this tutorial are borrowed from the article.
The full find language is pretty complex and consist of several dozens of different predicates and options. There are two versions of this language: one implemented in POSIX find and the second implemented in GNU find which is a superset of POSIX find. That can make big difference in complex scripts. But for interactive use the differences is minor: only small subset of options is typically used on day-to-day basis by system administrators. Among them:
- -name True if pattern matches the current file name. Simple regex (shell regex) may be used. A backslash (\) is used as an escape character within the pattern. The pattern should be escaped or quoted. If you need to include parts of the path in the pattern in GNU find you should use predicate wholename
Use the -iname predicate (GNU find supports it) to run a case-insensitive search, rather than just -name. For example:
$ find . -follow -iname '*.htm' -print0 | xargs -i -0 mv '{}' ~/webhomeUsage of -print0 is a simple insurance for the correct processing of files with spaces.
- -fstype type True if the filesystem to which the file belongs is of type type. For example on Solaris mounted local filesystems have type ufs (Solaris 10 added zfs). For AIX local filesystem is jfs or jfs2 (journalled file system). If you want to traverse NFS filesystems you can use nfs (network file system). If you want to avoid traversing network and special filesystems you should use predicate local and in certain circumstances mount
- "-atime/-ctime/-mtime" [+|-]n
Specify selection of the files based on three Unix timestamps: the last time a files's "access time", "file status" and "modification time".
n is time interval -- an integer with optional sign. It is measured in 24-hour periods (days) or minutes counted from the current moment.- n: If the integer n does not have sign this means exactly n 24-hour periods (days) ago, 0 means today.
- +n: if it has plus sing, then it means "more then n 24-hour periods (days) ago", or older then n,
- -n: if it has the minus sign, then it means less than n 24-hour periods (days) ago (-n), or younger then n. It's evident that -1, and 0 are the same and both means "today".
Note: If you use parameters with find command in scripts be careful when -mtime parameter is equal zero. Some (earlier) versions of GNU find incorrectly interpret the following expression
find -mtime +0 -mtime -1
which should be equivalent tofind -mtime -1
but does not produce any files- n: If the integer n does not have sign this means exactly n 24-hour periods (days) ago, 0 means today.
- +n: if it has plus sing, then it means "more then n 24-hour periods (days) ago", or older then n,
- -n: if it has the minus sign, then it means less than n 24-hour periods (days) ago (-n), or younger then n. It's evident that -1 and 0 are the same and both means "today".
- Examples:
- Find everything in your home directory modified in the last 24 hours:
- find $HOME -mtime -1
- find $HOME -mtime -1
- Find everything in your home directory modified in the last seven 24-hour periods (days):
- find $HOME -mtime -7
- find $HOME -mtime -7
- Find everything in your home directory that have NOT been modified in the last year:
- find $HOME -mtime +365
- find $HOME -mtime +365
- To find html files that have been modified in the last seven 24-hour periods (days), I can use -mtime with the argument -7 (include the hyphen):
find . -mtime -7 -name "*.html" -printIf you use the number 7 (without a hyphen), find will match only html files that were modified exactly seven 24-hour periods (days) ago:
find . -mtime 7 -name "*.html" -print - To find those html files that I haven't touched for at least seven 24-hour periods (days), I use +7:
find . -mtime +7 -name "*.html" -print
- Find everything in your home directory modified in the last 24 hours:
- n: If the integer n does not have sign this means exactly n 24-hour periods (days) ago, 0 means today.
- -newer/-anewer/-cnewer baseline_file The time of modification, access time or creation time are compared with the same timestamp in the baseline file. If file is a symbolic link and the -H option or the -L option is in effect, the modification time of the file it points to is always used.
- -newer Modification time is compared with modification time of the basline_file True if file was modified more recently than baseline file.
- -anewer Access time is compared with access time of basline_file . True if file was last accessed more recently than baseline file.
- -cnewer Creation file is compared. For example: find everything in your home that has been modified more recently than "~joeuser/lastbatch.txt ":
- find $HOME -newer ~joeuser/lastbatch.txt
- find $HOME -newer ~joeuser/lastbatch.txt
- -newer Modification time is compared with modification time of the basline_file True if file was modified more recently than baseline file.
- -local True if the file system type is not a remote file system type. In Solaris those types are defined in the /etc/dfs/fstypes file. nfs is used as the default remote filesystem type if the /etc/dfs/fstypes file is not present. The -local option skips the hierarchy of non-local directories. You can also search without descending more then certain number of levels as explained later or exclude some directories from the search using
- -mount Always true. Restricts the search to the file system containing the directory specified. Does not list mount points to other file systems.
- -xdev Same as the -mount primary. Always evaluates to the value True. Prevents the find command from traversing a file system different from the one specified by the Path parameter.
- -xattr True if the file has extended attributes.
- -wholename simple-regex [GNU find only] . File name matches simple regular expression (often called shell patterns). In simple regular expressions the metacharacters '/' and '.' do not exist; so, for example, you can specify:
find . -wholename '/lib*'which will print entries from directories /lib64 and /lib. To ignore the directories specified, use option -prune For example, to skip the directory /proc and all files and directories under it (which is important for linux as otherwise errors are produced you can something like this:find . -wholename '/proc' -prune -o -name file_to_be_found
If you administer a lot of linux boxes it is better to create alias ff:if [[ `uname` == "Linux" ]] ; do
alias ff='find . -wholename '/proc' -prune -o -name '
else
ff='find . -name ' # not GNU find does not support -wholename
fi
Other useful options of the find command include:
- -regex regex [GNU find only] File name matches regular expression. This is a match on the whole pathname not a filename. Stupidly enough the default regular expressions understood by find are Emacs Regular Expressions, not Perl regular expressions. It is important to note that "-iregex" option provide capability to ignore case.
- -perm permissions Locates files with certain permission settings. Often used for finding world-writable files or SUID files. See below
- -user Locates files that have specified ownership. Option -nouser locates files without ownership. For such files no user in /etc/passwd corresponds to file's numeric user ID (UID). such files are often created when tar of sip archive is transferred from other server on which the account probably exists under a different UID)
- -group Locates files that are owned by specified group. Option -nogroup means that no group corresponds to file's numeric group ID (GID) of the file
- -size Locates files with specified size.
-sizeattribute lets you specify how big the files should be to match. You can specify your size in kilobytes and optionally also use+or-to specify size greater than or less than specified argument. For example:find /home -name "*.txt" -size 100kfind /home -name "*.txt" -size +100kfind /home -name "*.txt" -size -100kThe first brings up files of exactly 100KB, the second only files greater than 100KB, and the last only files less than 100KB.
- -ls list current file in `ls -dils' format on standard output.
- -type Locates a certain type of file. The most typical options for -type are as following:
- d -Directory
- f - File
- l - Link
For example to find a list of the directories use can use the -type specifier. Here's one example:
find . -type d -print
Tuesday, June 2, 2009
Oooooh.... Beautiful....
And I am ok impressed.
But the links....
cgafaq wiki
The plethora of source codes.... Oh.... I am going to pee in my pants...
http://www.geometrictools.com/index.html
Seriously... I mean pee like a broken damnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.
And look at the resources link provided:
http://www.geometrictools.com/Resources/Links.html
OpenGL: glLineWidth
glLineWidth(20.0f);
glBegin(GL_LINES);
//draw vertices
glVertex3f (-10f, -10.0f, -10.0f);
glVertex3f (10f, 10.0f, 10.0f);
....
glEnd();
Note that not all hardware supports a line width of 20. To find out the supported range and line width increments call:
float sizes, increment;
glGetFloatv(GL_LINE_WIDTH_RANGE, sizes)
glGetFloatv(GL_LINE_WIDTH_GRANULARITY, &increment)
Modules selection
Next Sem: Y2 S1
Computer Animation and Simulation
3D Modelling and Reconstruction
Y2 S2
Human Computer Interaction
Scientific Visualization
Y2 S3
Introduction to Games Design
BI6129 Directed Reading
I am actually quite excited for school. Hehe.
Monday, June 1, 2009
YAY! I Passed~~
Yes, I am drunk. On happiness.
No, you really look drunk.
Oh yes. I am going to write a one hit wonder. And get so rich on it, I don't need to work. Oh yes... That sounds perfect.
Stop eating the gummy. You're getting a sugar high.
Thursday, May 21, 2009
Vista TWEAKS
So here are some guides on tweaking and optimising which I cannot guarantee works.
At least my batch scripts still works here. Hehe. Cool...
http://www.tweakhound.com/vista/tweakguide/page_2.htm
http://www.iamshadowlord.com/2007/06/windows-vista-optimization.html
Sunday, April 19, 2009
VR: Stereoscopic Projection - parallax problems
http://local.wasp.uwa.edu.au/~pbourke/exhibition/vpac/theory.html
Sunday, April 12, 2009
Music to listen to while you're studying
How to categorise that?
1. Not too slow or soft or soothing that you might fall asleep.
2. Nothing and I mean nothing that can distract you, (so you should not listen to any songs in languages that you understand or can sing along to).
These are the choices given by some people:
1. Brian Eno - Music for Airports
2. Boards of Canada -- > ooh I've been meaning to get their music.
3. Sigur Ros - They make me trip. I can't use this for studying.
4. Chicane - Ooh nice... must get their music.
5. Kaskade - Nice nice... Must get them too!!
6. Cirque du Soleil - oooooo?
Someone suggested these:
- Sigur Rós - any of their albums are great, especially their b-sides/EPs
- Mogwai
- Boards of Canada as mentioned
- Haibane Renmei - "Hanenone" - excellent soundtrack to an excellent anime
- Any of the Final Fantasy Piano Collections (well, except IV and V, they're pretty unimaginative)
- Film scores (particular favorites of mine are "Final Fantasy: The Spirits Within," "Crouching Tiger, Hidden Dragon," "Hero," "American Beauty," and "Crash")
http://www.amazon.com/Music-Listen-While-Youre-Studying/lm/CTMB4VPEAPU9
My personal all time favourite has to be JAM and Yuki Isoya (solo effort), Shiina Ringo (given to me by accident). When I hear JAM, I just want to start Xcode or pick up my notes.
Animation: Classical Framework
Stimulus
1. Environment Model: Animation's environment where static and dynamic objects are created. Includes modeling and rendering.
2. Perception Model: Techniques of "perception" by the characters. Information detected by the character's sensory capabilities.
i. zonal approach
ii. sensory approach
iii. synthetic vision approach.
Response
3. Behavioural Model: Behavioural techniques provide the characters with ability to autonomous activity with its own decision. This can either be reactive or driven by internal desire/experiences (not so much Artificial Intelligence, but more Artificial Life....? )
i. Rule-based approach
ii. Network approach
iii. Artificial Intelligence approach
iv. Mathematical approach
4. Motor Model: Movement techniques - to move & animate the characters. Not related to planning of movement, that is done in behavioural model.
i. Basic dynamic approach
ii. Procedural approach
More references:
http://www.red3d.com/cwr/boids/
Wednesday, April 8, 2009
Some physics
http://theory.uwinnipeg.ca/mod_tech/index.html
This is good for what I need to know:
http://www.kwon3d.com/theory/rigid.html
Moment of Inertia (good diagram here):
http://hyperphysics.phy-astr.gsu.edu/HBASE/inecon.html
Tuesday, April 7, 2009
Tuesday, March 31, 2009
Trigonometric Identities
for derivatives, look at the Calculus part or the table of derivatives.
Sunday, March 29, 2009
Saturday, March 28, 2009
Timestep integration
Very good to get the basics of time step transformation.
Friday, March 27, 2009
Matrix Vector hints
Matric and various vector math hints and tips.
-------------------------------------------------------------------------------
General Matrix calculation is by
[x,y,z] * M => [x',y',z']
|x| |x'|
or M * |y| => |y'|
|z| |z'|
The result is the same in either case. As long as the matrix was created using
row vectors OR column vectors to match!
Which style is used is up to the matrix library version you use. I prefer
the former, which The perl Math::MatrixReal library seems to like the later.
Just note the order.
-------------------------------------------------------------------------------
Matrix and what the terms actually mean...
From the povray matrix page..
http://enphilistor.users4.50megs.com/matrix.htm
Generally a matrix is defined (at least in Povray) as...
| A.x A.y A.z 0 |
| B.x B.y B.z 0 |
| C.x C.y C.z 0 |
| D.x D.y D.z 1 |
This can be thought of a a matrix of four (row) vectors A, B, C, D
where A = | A.x, A.y, A.z, 0 | etc. (NB: A.x is the x component of A)
What this matrix does is wrap the 3D space so that the X axis moves (rotates,
scales, shear, etc) to vector A, ditto for Y -> B and Z -> C. The last vector
D is the new location for the Origin (translate).
As the page above specifies this means that if you create a set of orthogonal
vectors A,B,C general rotations are very easy to do, and goes on to provide a
two part solution to rotating any general vector to any other general vector
(while retaining an general up direction).
-------------------------------------------------------------------------------
Orthogonal Matrices
A matrix is orthogonal if each of the three vectors making up the matrix
are orthogonal. That is they are all perpenducular to each other.
This is true of all rotation matrices (no scaling or shear).
What is interesting is that the inverse of such matrices is also its
transpose. And that matrix in itself is also orthogonal.
This means if we have a rotation matix
| A.x A.y A.z |
| B.x B.y B.z |
| C.x C.y C.z |
To rotate the x,y,z axises to the A,B,C vectors, then it so happens that
the inverse (rotate A,B,C vectors to the x,y,z axises) is the matrixes
transpose (diagonal mirror).
| A.x B.x C.x |
| A.y B.y C.y |
| A.z B.z C.z |
-------------------------------------------------------------------------------
Rotation Matrices are...
Normilized or Each row or column are unit vectors (vector length = 1)
Orthogonal or Dot product of any row to to any other row
or column to column is 0
EG: All row or column vectors are perpendicular to each other
Its Inverse is also its Transpose (due to orthogonality)
-------------------------------------------------------------------------------
Rotation Matrix about axis (x,y,z) and angle a
Given that s = sin(a) c = cos(a) t = (1 - cos(a))
and x, y, z defines the axis you want to rotate around
then, the rotation matrix is...
| txx+c txy+sz txz-sy |
R = | txy-sz tyy+c tyz+sx |
| txz+sy tyz-sx tzz+c |
For very small angles (and you later occasionally re-normalize)
A technique often used for interactive rotations using a mouse.
Then s = sin(a) => a c = cos(a) => 1 t => 0
and thus rotation becomes
| 1 za -ya |
R = | -za 1 xa |
| ya -xa 1 |
Given a orthogonal rotation matrix
Then the axis and angle of rotation can be found using...
cos(a) = ( R[0][0] + R[1][1] + R[2][2] - 1 ) / 2
axis = ( R[1][2]-R[2][1], R[2][0]-R[0][2], R[0][1]-R[1][0] ) / 2*sin(a)
-------------------------------------------------------------------------------
General Rotatation of a unit vector V to unit vector W
(rotation in same plain as both vectors - ie: the minimal rotation)
This is complex and difficult if you try to generate it using the
above general axis and angle method. The following generates it faster
and more simply, without need for sin() and cosin() functions, using the
meaning of the three vectors in a roatation matrix.
To do this requires three steps...
1/ Matrix to rotate the Vector V onto some arbatary axis (eg: X)
but such that the vector W also rotates to W' in the XY plan!
2/ One to rotate about the Z axis so that the rotated vector V'
(which is now at the X axis) is rotated to W' in that frame work.
3/ Rotate back to the original axis frame work by using the
inverse (transpose) of the original rotation.
First Step
It is easier to calculate the last step and invert the matrix, so...
We need to find two more unit vectors orthogonal to the original
vector V. One of these vectors must be the axis of rotation
so it can be moved to the Z axis for the second step.
Find the axis of rotation N
N = normalised ( V x W )
And the other orthogonal axis to complete the axis frame work.
M = N x V (note M is unit length as N and V are orthoginal)
alturnativally...
M = normailzed( V x W x V )
to rotate the X Y Z axis to this frame work would thus be...
| Vx, Vy, Vz |
Q = | Mx, My, Mz | (NB: a matrix of row vectors)
| Nx, Ny, Nz |
But for this step we want to do the oppisite! So inverse the orthogonal
matrix by transposing (diagonal flip). So the first step is....
transpose(Q)
Second Step
The new location of V (or V') which is now the X axis, needs to be rotated
around Z (now the axis of rotation), to the new location of W or W'
W' = W * transpose(Q)
As the Z axis does not rotate we only need the new location of the Y
axis in this step to complete this step.
Y' = W' Zrotate(90deg)
= Z x W'
The actual rotaton matrix in this axis framework is thus...
| W'x, W'y, W'z |
T = | Y'x, Y'y, Y'z |
| Zx, Zy, Zz | <- This is just (0, 0, 1)
Third Step
We just rotate back to the original coordinate system...
This was the original matrix Q calculated in step one.
The completed rotation matrix is thus..
Rotate_V_to_W = R = transpose(Q) * T * Q
===============================================================================
The following is vector stuff, not matrix...
-------------------------------------------------------------------------------
Distance of a point to a line.
Given line AB, Point C some distance away.
Minimim distance of C to line (perpendicular to line)
r = (AB . AC) / |AB|^2
WRONG: that is the distance of C from A in the direction of A to B!
That is length along the line!
-------------------------------------------------------------------------------
From http://www.cit.gu.edu.au/~anthony/info/graphics/matrix_vector.hints
Thursday, March 26, 2009
Perl RegEx reference
Conventions
The following conventions are used in the examples.
metacharacter(s) ;; the metacharacters column specifies the regex syntax being demonstrated
=~ m// ;; indicates a regex match operation in perl
=~ s/// ;; indicates a regex substitution operation in perl
Also worth noting is that these regular expressions are all Perl-like syntax. Standard POSIX regular expressions are different.
[edit] Examples
Unless otherwise indicated, the following examples conform to the Perl programming language, release 5.8.8, January 31, 2006. The syntax and conventions used in these examples coincide with that of other programming environments as well (e.g., see Java in a Nutshell - Page 213, Python Scripting for Computational Science - Page 320, Programming PHP - Page 106 ).
| Metacharacter(s) | Description | Example Note that all the if statements return a TRUE value |
|---|---|---|
| . | Normally matches any character except a newline. Within square brackets the dot is literal. | $string1 = "Hello World\n"; |
| ( ) | Groups a series of pattern elements to a single element. When you match a pattern within parentheses, you can use any of $1, $2, ... later to refer to the previously matched pattern. | $string1 = "Hello World\n";Output:
|
| + | Matches the preceding pattern element one or more times. | $string1 = "Hello World\n";Output:
|
| ? | Matches the preceding pattern element zero or one times. | $string1 = "Hello World\n"; |
| ? | Modifies the *, +, or {M,N}'d regexp that comes before to match as few times as possible. | $string1 = "Hello World\n"; |
| * | Matches the preceding pattern element zero or more times. | $string1 = "Hello World\n"; |
| {M,N} | Denotes the minimum M and the maximum N match count. | $string1 = "Hello World\n"; |
| [...] | Denotes a set of possible character matches. | $string1 = "Hello World\n"; |
| | | Separates alternate possibilities. | $string1 = "Hello World\n"; |
| \b | Matches a word boundary. | $string1 = "Hello World\n"; |
| \w | Matches an alphanumeric character, including "_". | $string1 = "Hello World\n"; |
| \W | Matches a non-alphanumeric character, excluding "_". | $string1 = "Hello World\n"; |
| \s | Matches a whitespace character (space, tab, newline, form feed) | $string1 = "Hello World\n"; |
| \S | Matches anything BUT a whitespace. | $string1 = "Hello World\n"; |
| \d | Matches a digit, same as [0-9]. | $string1 = "99 bottles of beer on the wall.";Output:
|
| \D | Matches a non-digit. | $string1 = "Hello World\n"; |
| ^ | Matches the beginning of a line or string. | $string1 = "Hello World\n"; |
| $ | Matches the end of a line or string. | $string1 = "Hello World\n"; |
| \A | Matches the beginning of a string (but not an internal line). | $string1 = "Hello\nWorld\n"; |
| \Z | Matches the end of a string (but not an internal line). | $string1 = "Hello\nWorld\n"; |
| [^...] | Matches every character except the ones inside brackets. | $string1 = "Hello World\n"; |
http://en.wikipedia.org/wiki/Regular_expression_examples
Tuesday, March 24, 2009
Sunday, March 22, 2009
Physically based animation
http://www.cs.cornell.edu/courses/cs567/2007sp/
Which leads to these information:
http://www.cse.ohio-state.edu/~parent/animation/index1.html
And these Pixar Research papers are great read:
http://www.pixar.com/companyinfo/research/pbm2001/
Saturday, March 21, 2009
Thursday, March 19, 2009
Semester 2: Them
Prof Q
"How's my english? Ok?"
"A lot of maths har? It's not my fault. It's your fault. You chose engineering."
"Ah-har! Let's prove that! Good!"
"So we've proven that! Great. Good. Hehe. Maths again? Well, it is after all the tradition now."
"If you are going to do research on computer vision, you will definitely hear of this guy... And use his snake method and wavelet form... Clever clever guy." (in awe)
VR
Prof Fox
"I can't help you there if your partner is a virtual partner..." Laughs to himself.
-When I told him I am not sure if my partner still wants me in her team for the paper reading.
"Here let me show you. If you sweep in parallel from x-axis, this polo mint will look like it's colliding with this object. But iterate the sweep through all 3 axis and you will realise it was just visual occlusion... Take polo at own risk. Hehe." Pops a mint.
He does all the yar and says idea as "ide" like a typical german guy.
Common mathematical pdf
Very very nice. He's more into data mining so his algorithms' mostly on clustering and search.
http://www.autonlab.org/tutorials/index.html
Also like his humour:
Primary goal in life: Occasion to use the phrase: "Let me through---I'm a Computer Scientist!"
Monday, March 16, 2009
Semi-implicit Euler method
v_{n+1} = v_n + g(t_n, x_n) \, \Delta t \quad
x_{n+1} = x_n + f(t_n, v_{n+1}) \, \Delta t \quad
where Δt is the time step and t_n = t_0 + n\,\Delta t is the time after n steps.
The difference with the standard Euler method is that the semi-implicit Euler method uses vn + 1 in the equation for xn + 1, while the Euler method uses vn.
The semi-implicit Euler is a first-order integrator, just as the standard Euler method. This means that it commits a global error of the order of Δt. However, the semi-implicit Euler method is a symplectic integrator, unlike the standard method. As a consequence, the semi-implicit Euler method almost conserves the energy (when the Hamiltonian is time-independent). Often, the energy increases steadily when the standard Euler method is applied, making it far less accurate.
From wikipedia: http://en.wikipedia.org/wiki/Symplectic_Euler_method
Sunday, March 15, 2009
Quaternion
Beginners start here:
http://www.gamedev.net/reference/articles/article1095.asp
Friday, March 13, 2009
Sony Vegas wins hands down.
However, I just realised our happy dancing music was quite crap and turns out to be actually creepy. SO I've replace it with:
More on:
http://movie-tv-reviews.blogspot.com/
I love being asian. Look no further than any asian female music and it's all kawaii!!
Sony Vegas vs blender
How I wanted to use blender. I mean wow... blender is opensource and includes non-linear editting? I am impressed... But using it is a bitch! I tried following the instructions below... Too complicated for my brain to adhere.
http://eugenia.gnomefiles.org/2008/04/20/video-editing-with-blender/
So gotten a trial of Sony Vegas 7 (unfortunate eh? Since I am still on Windows 2000). Let's see who will win.
Thursday, March 12, 2009
Importing AVI to iMovie
SO how??? Here I am with scene 1 - 5 ready to for audio editing and the idiot just won't add the clips!
Turns out I will need to convert it to an older avi version for iMovie to recognise and import properly... Wokay...
Follow this instructions: http://www.helium.com/items/1255708-how-to-convert-video-for-imovie
Ok, the above doesn't work. And MPG2 video that's muxed will not import into iMovies either. WHaaaaaaaaaaaaat?
http://support.apple.com/kb/HT1372
But I should use expert settings when exporting the movie:
http://forums.macrumors.com/showthread.php?t=302197
Tuesday, March 10, 2009
Creating dust particles?
The steps should be:
Create curve.
Particles --> Create emitter.
Then have fun from there onwards... But oh well...
http://forums.creativecow.net/archivethread/2/761053
http://www.highend3d.com/boards/index.php?showtopic=236247
http://forums.cgsociety.org/archive/index.php/t-416001.html
http://www.swinburne.edu.au/design/tutorials/P-maya/T-Maya-Dynamics-Transforming-objects-using-magic-star-dust-particles/ID-119/
This swinburne institution is really something... but the name... aiyo....
Sunday, March 8, 2009
3D text in Maya
So we had to import the lettering from either Photoshop or Illustrator. We went with Photoshop as described in the tutorial below:
http://en.9jcg.com/comm_pages/blog_content-art-64.htm
Besides that, we also need to extrude the text. We've used Surfaces: Surfaces--> Loft and Surfaces--> Planar. Then group the each letter together.
However, from the same author, there's another way of doing it:
http://www.youtube.com/watch?v=JJwNOOmkZuU
Saturday, February 28, 2009
Wrestling with Maya
What a load of crap... We jumped in without even knowing how to navigate maya... Haiz...
Anyhow... This is an important discovery for the rigging pipeline:
1. Align:
a. Model (textured)
b. Joints
c. Nurbs circle
How to align? Make sure all the 3 above are at point of origin. Check the attributes (Ctrl+A) on the node. I had to realign the joints manually, then translate the model & circle accordingly. But it was not so hard after realising what to do. It's the "How do I do this" that really wasted a lot of my time.
Then:
Modify-->Center Pivot
Modify-->Freeze Transformation
Constraint!!!
Joints + Circle
Constrain-->Orient
Constrain-->Points
Now follow this process to the T!
ALWAYS SET THE IK FIRST BEFORE binding the skin!
Skin --> Bind Skin --> Smooth Bind
This way, the nurbs circle will create a marionette (? wiki check later) for controlling instead of controlling the individual joints.
Then Paint Yer Skin Weights to the joints........... Grr... I did this so many times I want to cry....
Skin-->Edit Smooth Skin-->Paint Skin Weights
There's an "A-har!" here. Always start from the outermost joint, working your way in... And always toggle hold weight.
On painting weights.
Personally, I like to flood with full black bg, then work in the selected joint area.
After that, check the attributes of the joints. Ctrl+A.
Sometimes, this could be turned off. Right Click to see if it's toggled on. X=On.
The most important thing here for natural looking joint bends is the:
Smooth Skin Parameters!!!!
So take care of that here.
Thursday, February 26, 2009
Quick: Maya Tutorial
This really saved me in a lot of ways. Thank you, wonderhowto.
For more than the basics:
http://www.wonderhowto.com/search/maya/by-most-popular/
Wednesday, February 25, 2009
Windows- Adding new fonts
C:/Windows/Fonts
C:/WINNT/Fonts
add your *.tff files here.
Your fonts will be automatically installed.
Oh well... I am so forgetful I need this.
More on this here: http://graphicssoft.about.com/od/photoshop/qt/photoshopfonts.htm
Thursday, February 19, 2009
Understanding the basics of Linux routing
http://articles.techrepublic.com.com/5100-10878_11-1052888.html
Friday, February 6, 2009
Thursday, February 5, 2009
Inverse Kinematics -- help for assignment
http://answers.google.com/answers/threadview?id=43974
http://math.ucsd.edu/~sbuss/ResearchWeb/ikmethods/index.html
http://www.devmaster.net/forums/showthread.php?t=7211
http://www.codeguru.com/forum/showthread.php?t=299690
http://www.cours.polymtl.ca/roboop/docs/html/classmRobot.html
http://www.gamedev.net/community/forums/topic.asp?topic_id=516688
Readings!!!!
http://csci520.googlepages.com/
uuuuu useful tools: http://www.sharewareconnection.com/titles/inverse-kinematics.htm
Phoneme shapes to animate speaking characters
Extended Preston Blair phoneme series
It always amazes me how few phoneme shapes you really need to give the impression of a talking character. This article covers a slightly extended range of phoneme mouth shapes, based originally on the Preston Blair series. This extended set adds a few extra mouth poses useful for sequencing mouth movement to dialogue tracks. The main additions to the Preston Blair series is a specific phoneme shape just for Th (as in thanks or thrash) and an additional phoneme shape for the C, D, G, K, N, R, S, Y and Z sounds, which is similar to E but provides an extra target pose when you have a run of sounds that are similar in mouth shape (but need some slight variation for contrast). I find these occur frequently enough to deserve their own poses.
Getting started
Each phoneme shape shown here is accompanied by example word sounds, these are by no means golden rules always be followed - but are there as examples of the kind of sounds the mouth shape represents. If it looks correct, then it is correct and the best trick to getting lip synch looking correct is have an easy way to repeatedly preview your sequence along with your soundtrack so you can go back over the sequence again and again fine tuning poses. Some lip-synch tools (as included with Hash Inc. Animation:Master) provide quick and productive ways of generating your dopesheet timing, other video sequencing programs can also be used to calculate your pose timings but require a more manual process (such as Adobe Premiere).
Phoneme A I
Example sounds are: apple, day, hat, happy, rat, act, plait, dive, aisle.
Phoneme E
Example sounds are: egg, free, peach, dream, tree.
Phoneme O
Example sounds are: honk, hot, off, odd, fetlock, exotic, goat.
Phoneme U
Example sounds are: fund, universe, you runner, jump, fudge, treasure.
Phoneme C D G K N R S Y Z
Example sounds are: sit, expend, act, pig, sacked, bang, key, band, buzz, dig, sing.
Phoneme C D G J K N R S Y Z
Example sounds are: grouch, rod, zoo, kill, car, sheep, pun, dug, jaw, void, roach, lodge.
Phoneme F V
Example sounds are: forest, daft, life, fear, very, endeavour.
Phoneme Th
Example sounds are: the, that, then, they, this, brother.
Phoneme L
Example sounds are: election, alone, elicit, elm, leg, pull.
Phoneme M B P
For many M, B and P sounds, it's important that the phoneme shape should be reached before the M, B or the P sound is made, the sound is often only made as the pose breaks. Example words are: embark, bear, best, put, plan, imagine, mad, mine.
Phoneme W Q
Example sounds are: cower, quick, wish, skewer, how.
The rest shape
The rest shape is not a phoneme as such but a shape used during pauses between words and sentences.
Get the tweening right
In addition to placing the correct phoneme shape next to dialogue sound, keep in mind how your software tweens from phoneme pose to pose, the default settings are rarely good enough. When you need a clear definition of a particular mouth shape you'll need to space matching or similar mouth poses at the start and end of the hold. A common example is during the rest point between spoken sounds, where mouth movement often pauses. Don't forget you'll need to go deeper in and adjust the timing curves of your phoneme sequence to get the ease in and out of mouth motion looking natural. Rendering after each animation pass - playing the sequence against the audio track is really the best way of catching problem areas and refining your work. My final comment is try not to over cook your phoneme keys (don't have too many). Pick the important sounds and hit their shape clearly to emphasize the dialogue flow. Best of luck!
Related links
- Preston Blair reference mouth shapes
- Hobbit phoneme character face examples
- Wizard phoneme quick animated example
- VST plugin wizard vocal musical interface element
- Principles for Lip Synch Animation by Keith Lango
- Lip Sync Making Characters Speak by Michael B. Comet
Extended Preston Blair phoneme series
It always amazes me how few phoneme shapes you really need to give the impression of a talking character. This article covers a slightly extended range of phoneme mouth shapes, based originally on the Preston Blair series. This extended set adds a few extra mouth poses useful for sequencing mouth movement to dialogue tracks. The main additions to the Preston Blair series is a specific phoneme shape just for Th (as in thanks or thrash) and an additional phoneme shape for the C, D, G, K, N, R, S, Y and Z sounds, which is similar to E but provides an extra target pose when you have a run of sounds that are similar in mouth shape (but need some slight variation for contrast). I find these occur frequently enough to deserve their own poses.
Getting started
Each phoneme shape shown here is accompanied by example word sounds, these are by no means golden rules always be followed - but are there as examples of the kind of sounds the mouth shape represents. If it looks correct, then it is correct and the best trick to getting lip synch looking correct is have an easy way to repeatedly preview your sequence along with your soundtrack so you can go back over the sequence again and again fine tuning poses. Some lip-synch tools (as included with Hash Inc. Animation:Master) provide quick and productive ways of generating your dopesheet timing, other video sequencing programs can also be used to calculate your pose timings but require a more manual process (such as Adobe Premiere).
Phoneme A I
Example sounds are: apple, day, hat, happy, rat, act, plait, dive, aisle.
Phoneme E
Example sounds are: egg, free, peach, dream, tree.
Phoneme O
Example sounds are: honk, hot, off, odd, fetlock, exotic, goat.
Phoneme U
Example sounds are: fund, universe, you runner, jump, fudge, treasure.
Phoneme C D G K N R S Y Z
Example sounds are: sit, expend, act, pig, sacked, bang, key, band, buzz, dig, sing.
Phoneme C D G J K N R S Y Z
Example sounds are: grouch, rod, zoo, kill, car, sheep, pun, dug, jaw, void, roach, lodge.
Phoneme F V
Example sounds are: forest, daft, life, fear, very, endeavour.
Phoneme Th
Example sounds are: the, that, then, they, this, brother.
Phoneme L
Example sounds are: election, alone, elicit, elm, leg, pull.
Phoneme M B P
For many M, B and P sounds, it's important that the phoneme shape should be reached before the M, B or the P sound is made, the sound is often only made as the pose breaks. Example words are: embark, bear, best, put, plan, imagine, mad, mine.
Phoneme W Q
Example sounds are: cower, quick, wish, skewer, how.
The rest shape
The rest shape is not a phoneme as such but a shape used during pauses between words and sentences.
Get the tweening right
In addition to placing the correct phoneme shape next to dialogue sound, keep in mind how your software tweens from phoneme pose to pose, the default settings are rarely good enough. When you need a clear definition of a particular mouth shape you'll need to space matching or similar mouth poses at the start and end of the hold. A common example is during the rest point between spoken sounds, where mouth movement often pauses. Don't forget you'll need to go deeper in and adjust the timing curves of your phoneme sequence to get the ease in and out of mouth motion looking natural. Rendering after each animation pass - playing the sequence against the audio track is really the best way of catching problem areas and refining your work. My final comment is try not to over cook your phoneme keys (don't have too many). Pick the important sounds and hit their shape clearly to emphasize the dialogue flow. Best of luck!
Related links
- Preston Blair reference mouth shapes
- Hobbit phoneme character face examples
- Wizard phoneme quick animated example
- VST plugin wizard vocal musical interface element
- Principles for Lip Synch Animation by Keith Lango
- Lip Sync Making Characters Speak by Michael B. Comet
Wednesday, January 14, 2009
Our book
Emily
10:31
i feel like he is lonely
same as us
deep inside we just need to share
vvsy@hotmail.com
10:31
yes
Emily
10:31
without worrying if ppl will laugh at us
vvsy@hotmail.com
10:31
i agree
we want so much in life
and in the end, we need to give up something
and alot of us choose the easiest
Emily
10:32
good say
vvsy@hotmail.com
10:32
which is friends
or company
because that is the hardest to control
so we choose the ones we can control
Emily
10:32
plswrite this down!!!!
for our book!!!!!!!!!!!
vvsy@hotmail.com
10:33
career, studies, freelance....
lol
yes yes
When true friends come in all modes
Emily
10:39
I dun like to pretend like I am some little lady
i just love to speak out my mind
hahah
the other i talked to siew peng
vvsy@hotmail.com
10:39
yes i a gree
Emily
10:39
we both feel that
how much we miss the buddies next to us
instead of pc screeen and handphone
vvsy@hotmail.com
10:40
i know....
and worst
we feel our pc buddies more fun than the ppl around us
siao....
Emily
10:40
hahahahhahah
true!!!!!!!!!!!!!!!!
i feel that everyone needs care
tell u another story
It's the little things that count
Emily
10:41
a client's parent passed away
i boguht a hallmark card
and sent to her
she always had account with us
jsut never put money
aftershe rec
she pump in more than rm 1 mio
vvsy@hotmail.com
10:42
WOAH
Emily
10:42
she is financial controller of that comoany
vvsy@hotmail.com
10:42
orh
Emily
10:42
she gets to decide where to put the surplus fund
vvsy@hotmail.com
10:42
i i see
it really is the little things that count.....................................
Emily
10:42
so i bought the hallmark card for rm 10
yes!
On beauty
beauty is not natural
beauty is an effort
Thursday, January 8, 2009
How to pace all the school modules
Difficult modules:
2D & 3D Animation
Scientific Visualization
Modules with a lot of assignments:
2D & 3D Animation
3D Modelling & Reconstruction
Computer Animation & Simulation
Easy modules:
HCI
This Sem:
VR (core)
2D & 3D Animation (core)
HCI (elective)????????????????????????
Up to this point, I've completed 1 elective.
Next Sem:
Interesting electives:
3D Modelling & Reconstruction
Computer Animation & Simulation
Scientific Visualization
So there... I've chosen the modules I am interested in.
Here's the difficult part. There's a choice here:
1. Dissertation: 6AU == 2 modules of study.
2. Directed reading: 3AU
Option 1 is similar to Full Time option.
Option 2 is a smaller scale of Dissertation but need another module to fulfill all the AU.
If I choose option 2, Then I am quite interested in:
Introduction to Games Design (elective)
The plan is to complete 2 modules each semester; therefore I will complete within 2.5 to 3 years. Ok... Sounds good.
BUT, must decide by this sem if I want to do dissertation or not. Choose your topic, girl.
Wednesday, January 7, 2009
Animation Pipeline
However, I am reading from: http://www.donbluth.com/academy.html
And here's what it's all about.
There are 5 major steps the animated film must go through after the script is approved and before the original score and final sound effects are added. They are:
1. Storyboard
2. Ruff Animation
3. Clean Up
4. Special Effects Animation
5. Final Color
I like how this guy puts it:
In the past, people would have said "assembly-line". In computer graphics, one uses the term "rendering pipeline" and I think it's possible that the term "animation pipeline" developed from it. It may well now be used for traditional animation as well, but I suspect that it came from computer graphics and animation.
"Pipelining" is a programming term. "Pipes" are a typical feature of UNIX-like operating systems. A "pipe" is an entity that makes it possible for different processes to communicate. In fact, this topic is called "Inter-Process Communication" or "IPC". Pipes are one way of performing IPC; there are others. A typical style of programming in UNIX-like environments involves the use of "filters". A "filter" is a program that reads the output of one program and writes to the input of another using pipes.
If you type a command at the command line that looks like this:
> program_a | program_b | program_c
the "|" characters represent pipes. If you're programming, you can create pipes explicitly in your program.
The process of creating complex computer graphics can be implemented in this way. A single, monolithic program doesn't have to do all the jobs. For example, you could write a modelling program that passes its output to a program that does hidden surface removal. It, in turn, passes its output to a program that performs the first stage of rendering. Rendering is quite a complex task, so it's reasonable to divide it up into several stages.
Laurence Finston
Wednesday, December 31, 2008
Why aren't we out partying?
When he asked,"Why aren't we out partying?"
I said,"I am wondering the same thing myself. We're like old people, eh? But doesn't matter. I want to sleep. I am sick."
He said,"Partying sucks anyway."
I looked at him,"Whatever, good night!"
So we ended up sick, both of us. Me fixing him TCM throat remedy. Him changing all the rugs. Me buying new duvet. Him clearing all the old furnitures. Me counting threads on the new bedsheets. Him rewiring the house's network. Me picking out new curtains.
We've gone from 25 to 65.
Sunday, December 21, 2008
Oral Fixation
What's that?
I bite. Now they're all infected and bleeding. When the new sem begins again, they will bleed even more.
You should do like that guy in Boston Legal. Bite on a wooden cigarette. For him, it's an ego trip.
I don't get it. I don't need an ego boost.
Ya... but it's still an oral fixation.
Gosh... You're such a perv.
Wednesday, December 17, 2008
All excited and no one to tell to
I sit in the office bursting with joy. Sadly, there's no one to tell to. And suddenly I say, "I wish he is here, I would really like to tell him."
My only friend in the office. And he's not here. Just for a moment, I wish he is here, so I can tell him about Siggraph. About scattering. About the technical papers presented. About everything.
Today, I want my only office buddy back. Because he's the only one whom I can talk to. And unfortunately, he still is.
Tuesday, December 16, 2008
Advanced Computer Graphics notes from WVU
Monday, December 15, 2008
I am watching you
At least spoof your network or something. This is too easy for me. Come on!
I am still watching you....
Thursday, December 11, 2008
Breathing the same air as Don Greenberg
But oh so tiring. Everyone was rushing and running around to attend their selected conferences, papers presentation, speech. I was being the usual polite girl as I was and wanted to wait till the applause quiet down before standing up to leave but I see others just walked out during applause.
You see, it's like those concerts... SXSW etc. Where at a given time a few dozen events, speeches, presentations, showreel, theatre are happening. So you really have to plan your time well. I only attend mostly the courses but I plot my itineraries at least one day ahead. Oh I better sleep now. Discrete geometry starts at 8:30am tomorrow.
Monday, December 8, 2008
Money is the root of all evil
Me: Yes.
He: Do you know how much you owe me?
Me: Err... 9k?
He: 11k. Do you have a financial plan?
Me: ... I am getting a few thousand soon. I can pay you 3k? As long as you feed me. Because I really don't have much.
He: I don't mean that. Just what about the ongoing? Do you have a plan?
Me: ...
He: Gosh. Now you're like the US govt. Even after you pay me the lump sum with your bonuses, can you afford the ongoing rent?
Me: ...
He: Can you not be such an airhead?
Me: But I am such an airhead.
He: You have to start planning your finances.
Me: I took a pay cut when I joined this company. That was the rent. They promised to give it back in 3 months but they didn't. I'll bet you didn't know that.
He: ...
Me: Let's see how it all goes. I can pay you back that sum with my bonus. Definitely! And then I will see how I can deal with the monthly part.
He: You better. Don't let it pile up.
I am officially broke and up to my neck in debts.
Friday, December 5, 2008
You can be really nasty in academics and no one will stop you
I have some of the nastiest professors and they just get away with it. Knowledge is really something, isn't it?
1. Prof Mint
"Hello class? Wah lau eh! Interactive lah? Only me talking, very boring wei."
*puts up all the stupid emails he received on powerpoint and presents it in lecture* "You asked me what is the best research topic to choose? Hey, you're the one doing it, not me."
"Anyone here? All sleeping? Haiz...."
2. Prof Elvis
"Well, if you want to know more, I can prove the whole equation here" *walks to the projector* "On second thoughts, it really ain't that interesting, I think I will skip this" *walks back to his notebook*
3. Prof Gerald
"You traverse through all the objects in your near child node, and recurse, recurse, recurse till you find a hit. Else, go to far child node and recurse, recurse, recurse" *flip his waist length hair*
3. Prof H
Professor H is by far the most mild of the lot. However, when I asked him about my assignment, he gave me the look like I was the kind of kid who used to bully him in school. Maybe I am. Mua ha ha.
Prof Sore Throat
"Hello?"
"Yello"
"Are you having a sore throat?" *I have the worst thought in the world. I was thinking that he might be waiting for a phone call from his office affair and wanted to to surprise her with a kewl voice*
"Why? Do I sound like I am having a sore throat?"
"Errr. Yes" *A no will suffice*
"What's a MAE prof doing chairing a computer graphics conference?"
"I get asked that a lot. It really is very strange, isn't it? I've been an active member since... since before you were even born!"
"I am really excited to attend this conference. I checked the speakers and some of them are the godfathers of computer graphics."
"There are a lot of computer graphics godfather here. Like this and that. Oh and you really have to attend this conference. And the fast forward. It is the pitch of their technical papers. And very funny."
"Somehow I think in academic, you get away with speaking your mind."
"Haha. Somewhat. This is still Singapore after all. But really, why would you say anything otherwise?"
"You should go for the reception. Let me check if students are invited for the reception. Hehe. I have people I can call that will tell me these things *gleeful*. Ok. Please attend the reception. I hope you get to mingle and meet people there."
I think... he is trying to say, network. Of course, Prof! I will!!!! You guys are too cool!
Our happy book
Em and I will try to self-publish a little happy book. It's gonna be mostly crap but our own happy crap.
She draws some of the cutest little things. Me? I am just a muse. Eerr... well I will provide the words. Somewhat. I thought I will defer and have all the time in the world to do it from next month onwards. But I guess not. We shall start now!
Wednesday, December 3, 2008
See what the monkeys got me

We were in Marks & Spencers when C asked me what's the best chocolate here.
I showed him the huge fruit cake and said, "I really want to eat this but it cost $69! You see the tag? And such a big cake. Oh it has cognac too. See?"
"Ok. I am getting this."
*totally flattered that he trusts my taste in food* "You're getting for your mum? Says here it will last till march."
"No. the guys are getting this for you."
"You're kidding me right? It's $69! For a cake! You know that is too expensive! Add another $8 and you can buy an ipod shuffle!!"
"No. You want this. So we're getting this for you."
"Noooooooooo this is mad. You're kidding right?" *I've been really nasty to them and they're so good to me?*
"Nope. I am going to pay now."
I didn't believe him till he paid and handed me the cake.
"Does this mean I can't call you monkey or say D is fat?"
I am so touched.... The indian boys want to feed me. Uhuk
Windows-how to write batch file
http://www.robvanderwoude.com/bht.html
I'll just use cygwin.
Oh wait. I found exactly what I need: http://www.cknow.com/tutorcom/dos08_dealwithfiles.htm
And some misc batch scripts by some misc person: http://www.geocities.com/~budallen/batfiles.html
Monday, December 1, 2008
1st Singapore Tattoo Show 2009
9th to 11th January 2009 at Singapore Expo.
I am so excited. Chris Garver from Miami Ink fame. Hmm... But of course, I am a little biased and absolutely in love with Kat von D. But woohoo!! I can't wait!
December and January is going to be so exciting for me.
Find the details here:
Singapore Expo Calendar
http://www.tattoo.com.sg/
Sunday, November 30, 2008
Thursday, November 27, 2008
Relaxing at work
We were all talking and telling stupid jokes and slam book? That is one good joke. Anyways we started exchanging stories about first crush and all. That's wierd. I don't tell colleagues my childhood stories. But I did this time. And we log into facebook and orkut for the whole show and tell.
"We can't see the picture of the guy you like. Why didn't you add him?"
"Why should I? He was my first crush. I was thirteen. Long time ago."
"Oooh. But we can't see his face."
"Doesn't matter."
Then we started talking about other stuff. I told them about SIGGRAPH Asia. One guy said, "Don't be so stingy. Just pay the $450 and go for it already."
"Pay money and sit in classes torturing myself with C++ and graphics programming?"
"You want to go."
He is right. I do.
Yes I will! I can't wait.
Tuesday, November 25, 2008
SIGGRAPH Asia 2008
Find the details here: http://www.siggraph.org/asia2008/attendees/index.php
Saturday, November 22, 2008
BD
So exams' over, I've submitted the project hours ago and I should be so relieved and sleep to make up for the past semester. But I can't. I mean yes, I am relieved and I woke up this morning shouting "Yay!" with my hands in the air (the other "Yay" is cause I will be seeing punjabi boy in January). But I can't sleep. I can't fall asleep. I just am not tired enough.
Maybe I am just hungry. I forgot to eat today. I just had some chips and coffee. That's lunch and dinner.
I can't sleep. I can't sleep. What do I do?? I fell into this site today. I forgot how. But I just did. So I started reading. And I thought, hmmm... Cool. Then I get a headache reading them. But I need to sleep and I will take any kind of torture just to be able to sleep. Or I could work on my Phong equation codes again. I don't want to. Too soon to start slaving away on the CG codes.
So here I am alternating between reading some call girls' blog and buying makeup online.
Friday, November 21, 2008
For the greater good?
That's what she was trying to imply.
Ok... Am I in trouble?
"I've been involved for the whole of this episode. We have rules for a reason. What we're doing now is not according to company protocols. But we realised you're an asset. I've heard good things about you. So we're doing this because it is beneficial to the company."
Oh... really? I've always thought I'm such a nuisance here.
"The managers and directors have all agreed on this. We've all come together and this is the decision we've made. For the company's benefit, we've all agreed to your transfer. Your new role starts on Jan 1st. I've heard good things about you. Except..."
Hold my breath.
"You talk to fast."
Huh?
In my own twisted world, I imagined the whole episode goes like the nuns' singing about Maria in Sound Of Music.
Thursday, November 20, 2008
glMatrixMode Cheat Sheet
{
glMatrixMode(GL_PROJECTION); // signal that I want to work with the projection stack
glLoadIdentity(); // make sure that the projection stack doesn't already have anything on it
gluPerspective(whatever I want); // set up a normal perspective projection
glMatrixMode(GL_MODELVIEW); // the rest of my app will only change MODELVIEW
glLoadIdentity(); // make sure that the modelview stack doesn't already have anything on it
}
void FunctionToDrawAFrame()
{
// modelview is still the active stack, because I never that setting
glPushMatrix(); // push current matrix up one, because I'm about to do a bunch of stuff that shouldn't remain active after the end of this function
/* position camera - whatever code you want, this is just an example */
glTranslatef(cameraX, cameraY, cameraZ);
glRotatef(cameraAngle, 0, 1, 0);
/* draw all objects */
for(all objects)
{
glPushMatrix(); //we don't want each object to move the camera...
glTranslatef(objectX, objectY, obectZ);
glRotatef(objectAngle, 0, 1, 0);
DrawObject(); // whatever method you use to draw your object
glPopMatrix(); //restore unaffected camera for next object
}
glPopMatrix(); // restore view prior to movement by this camera
}
From: http://www.allegro.cc/forums/thread/595000
Tron
Relentless Quark had to remind me the game they play in the movie. It's Light Cycle.
Anyways, for the uninitiated, here you go:
http://en.wikipedia.org/wiki/Light_Cycle
Wednesday, November 19, 2008
GL Mouse Picking and Selection
I think I might might have a solution to the mouse picking problem.
Could it be:
1. viewport problem?
2. matrix transformation problem?
3. z-buffer depth search problem - check in function processHits();
Read this: http://www.opengl.org/resources/faq/technical/transformations.htm
Wow! Very nice!!!!
3D Computer Graphics Tutorial:
http://www.jimbrooks.org/web/opengl/tutorials/
EDIT:
Was looking at the visitor stats and realised a lot of people come to this post when searching for OpenGL mouse picking. I've solved it.
Point is, if you want to pick in 3D; there's no straight forward way to doing that entirely in mouse.
What you can do is, specify another keyboard key + one mouse action for z-coordinate. Why? cause glut mouse function only specifies x,y coordinates. That's the easiest way to doing it.
That bugger
My heart did a leap. I've not seen him for the past 6 months.
How do you look like now?
Are you thinner? Are you older? How have you been?
Are you world weary now? Life can be cruel sometimes. Hang on. I am coming home soon.
I miss you. Can't wait to see you.
Tuesday, November 18, 2008
Stare at the table
No reaction from the crowd. I dare not breathe. In case breathing might offend. I hang my head and let my hair fall around my face. Hoping my face will be occluded.
Nobody say anything.
Nothing! Nothing! I held my breath till my face turned purple.
"Thank you for being with us for the past one year."
Is that the cue for me to speak? I still dare not. I smiled and nodded.
Continue staring at the table.
Monday, November 17, 2008
Get around
Read this on the sin and cos for 3D programming: http://pixwiki.bafsoft.com/mags/5/articles/circle/sincos.htm
Homogenous coordinates:
http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MOHR_TRIGGS/node7.html
This for better explanation on the 4x4 matrix as used in OpenGL.
http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drota.htm
2. 3D viewing and perspectives. Eye, World, Object view.
3. OpenGL commands...
4. Finish all the past year papers.
Sunday, November 16, 2008
Thank god?
Eerrr.... thank god? She's a real kryptonite?
Saturday, November 15, 2008
Sick Sick Sick!
If I don't finish CG today, I am not allowed to sleep. Ok. That's it!
Friday, November 14, 2008
The good girl
Her family.
Who listens to her parents... somewhat.
Does everything well.
Does everything they want her to, except... get married.
To a chinese boy.
Homogeneous. Just like her maths equations.
She will never defy them. And break their hearts.
So she chooses never to
But she will never tell them.
She just apologise and kept herself busy.
Here is where she will fail them.
All because,
she is hard to impress.
Strange dreams
Dreamt that I jumped into his car and he was driving around backwards.
Dreamt that bro was found guilty. Without bail. Confused.
Dreamt that my shoulder and ass hurts from dragging my bag around. Which could be true. Since it did hurt my shoulder very badly.
Dreamt about graphics pipeline. Dreamt about exams.
Dreamt about work. Dreamt about the dreaded meeting to announce my departure.
Wednesday, November 12, 2008
My first Christmas & New Year
Used to dread this time of the year. Spent most of the time in switch. Tortured, stressful, sleepless nights.
How about this year?
You are wasting my time look
I replied,"I have not finished talking yet. I will come to that part once I am done explaining this to you."
"Oh hehe. So I have to pay you? Ah with Malaqa money?"
*Look at him from the corner of my chinky eyes* "Can we continue?"
3D Game and Graphic Engine DB
http://www.devmaster.net/articles/graphics_alg/
Find it here. Check them out during sem break:
http://www.devmaster.net/engines/
Monday, November 10, 2008
Please, Just make up your mind!
Just make up your mind. Yes? No? Ok. Let's go!
And then there's the biggest longgok... lol. Love Jude's way of saying it.
School. Family. Work. All drama at the same time.
Jude told me it's alright to defer. As she puts it:
You don't want to fail and repeat school. And fail at work? Absolutely not. Cause we are the best!
I will buy her whatever she wants to eat after this. And she really can eat even though she is so small.
Embarassed closet maths nerd
http://projecteuler.net/index.php?section=about
I really do.
Sunday, November 9, 2008
All about R-tree
http://www.rtreeportal.org/
Saturday, November 8, 2008
My punishment
So I guess, I am really really making up for all of it now. Ugh!
Mean thought. I hope the rest of the class did badly too.
Why do I torture myself like that? I cannot explain.
Someone asked,"Why did you decided to do this?"
To which I replied, "To open my chakra."
Relational Algebra
Lecture Notes: Relational Algebra
What? Why?
- Similar to normal algebra (as in 2+3*x-y), except we use relations as values instead of numbers, and the operations and operators are different.
- Not used as a query language in actual DBMSs. (SQL instead.)
- The inner, lower-level operations of a relational DBMS are, or are similar to, relational algebra operations. We need to know about relational algebra to understand query execution and optimization in a relational DBMS.
- Some advanced SQL queries requires explicit relational algebra operations, most commonly outer join.
- Relations are seen as sets of tuples, which means that no duplicates are allowed. SQL behaves differently in some cases. Remember the SQL keyword distinct.
- SQL is declarative, which means that you tell the DBMS what you want, but not how it is to be calculated. A C++ or Java program is procedural, which means that you have to state, step by step, exactly how the result should be calculated. Relational algebra is (more) procedural than SQL. (Actually, relational algebra is mathematical expressions.)
Set operations
Relations in relational algebra are seen as sets of tuples, so we can use basic set operations.Review of concepts and operations from set theory
- set
- element
- no duplicate elements (but: multiset = bag)
- no order among the elements (but: ordered set)
- subset
- proper subset (with fewer elements)
- superset
- union
- intersection
- set difference
- cartesian product
Projection
Example: The table E (for EMPLOYEE)
| nr | name | salary |
|---|---|---|
| 1 | John | 100 |
| 5 | Sarah | 300 |
| 7 | Tom | 100 |
| SQL | Result | Relational algebra | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
select salary |
| PROJECTsalary(E) | ||||||||
select nr, salary |
| PROJECTnr, salary(E) |
Note that there are no duplicate rows in the result.
Selection
The same table E (for EMPLOYEE) as above.
| SQL | Result | Relational algebra | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
select * |
| SELECTsalary <>(E) | |||||||||
select * |
| SELECTsalary <>= 7(E) |
Note that the select operation in relational algebra has nothing to do with the SQL keyword select. Selection in relational algebra returns those tuples in a relation that fulfil a condition, while the SQL keyword select means "here comes an SQL statement".
Relational algebra expressions
| SQL | Result | Relational algebra | ||||||
|---|---|---|---|---|---|---|---|---|
select name, salary |
| PROJECTname, salary (SELECTsalary <>(E))
Temp <- SELECTsalary <>(E) |
Notation
The operations have their own symbols. The symbols are hard to write in HTML that works with all browsers, so I'm writing PROJECT etc here. The real symbols:
Example: The relational algebra expression which I would here write as
PROJECTNamn ( SELECTMedlemsnummer <> ( Medlem ) )
should actually be written
Cartesian product
The cartesian product of two tables combines each row in one table with each row in the other table.Example: The table E (for EMPLOYEE)
| enr | ename | dept |
|---|---|---|
| 1 | Bill | A |
| 2 | Sarah | C |
| 3 | John | A |
Example: The table D (for DEPARTMENT)
| dnr | dname |
|---|---|
| A | Marketing |
| B | Sales |
| C | Legal |
| SQL | Result | Relational algebra | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
select * |
| E X D |
- Seldom useful in practice.
- Usually an error.
- Can give a huge result.
Join (sometimes called "inner join")
The cartesian product example above combined each employee with each department. If we only keep those lines where the dept attribute for the employee is equal to the dnr (the department number) of the department, we get a nice list of the employees, and the department that each employee works for:
| SQL | Result | Relational algebra | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
select * |
| SELECTdept = dnr (E X D)
E JOINdept = dnr D |
- A very common and useful operation.
- Equivalent to a cartesian product followed by a select.
- Inside a relational DBMS, it is usually much more efficient to calculate a join directly, instead of calculating a cartesian product and then throwing away most of the lines.
- Note that the same SQL query can be translated to several different relational algebra expressions, which all give the same result.
- If we assume that these relational algebra expressions are executed, inside a relational DBMS which uses relational algebra operations as its lower-level internal operations, different relational algebra expressions can take very different time (and memory) to execute.
Natural join
A normal inner join, but using the join condition that columns with the same names should be equal. Duplicate columns are removed.Renaming tables and columns
Example: The table E (for EMPLOYEE)
| nr | name | dept |
|---|---|---|
| 1 | Bill | A |
| 2 | Sarah | C |
| 3 | John | A |
Example: The table D (for DEPARTMENT)
| nr | name |
|---|---|
| A | Marketing |
| B | Sales |
| C | Legal |
We want to join these tables, but:
- Several columns in the result will have the same name (nr and name).
- How do we express the join condition, when there are two columns called nr?
Solutions:
- Rename the attributes, using the rename operator.
- Keep the names, and prefix them with the table name, as is done in SQL. (This is somewhat unorthodox.)
| SQL | Result | Relational algebra | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
select * |
| (RENAME(enr, ename, dept)(E)) JOINdept = dnr (RENAME(dnr, dname)(D)) | ||||||||||||||||||||
select * |
| E JOINdept = D.nr D |
You can use another variant of the renaming operator to change the name of a table, for example to change the name of E to R. This is necessary when joining a table with itself (see below).
RENAMER(E)A third variant lets you rename both the table and the columns:
RENAMER(enr, ename, dept)(E)
Aggregate functions
Example: The table E (for EMPLOYEE)
| nr | name | salary | dept |
|---|---|---|---|
| 1 | John | 100 | A |
| 5 | Sarah | 300 | C |
| 7 | Tom | 100 | A |
| 12 | Anne | null | C |
| SQL | Result | Relational algebra | ||
|---|---|---|---|---|
select sum(salary) |
| Fsum(salary)(E) |
Note:
- Duplicates are not eliminated.
- Null values are ignored.
| SQL | Result | Relational algebra | ||
|---|---|---|---|---|
select count(salary) | Result:
| Fcount(salary)(E) | ||
select count(distinct salary) | Result:
| Fcount(salary)(PROJECTsalary(E)) |
You can calculate aggregates "grouped by" something:
| SQL | Result | Relational algebra | ||||||
|---|---|---|---|---|---|---|---|---|
select sum(salary) |
| deptFsum(salary)(E) |
Several aggregates simultaneously:
| SQL | Result | Relational algebra | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
select sum(salary), count(*) |
| deptFsum(salary), count(*)(E) |
Standard aggregate functions: sum, count, avg, min, max
Hierarchies
Example: The table E (for EMPLOYEE)
| nr | name | mgr |
|---|---|---|
| 1 | Gretchen | null |
| 2 | Bob | 1 |
| 5 | Anne | 2 |
| 6 | John | 2 |
| 3 | Hulda | 1 |
| 4 | Hjalmar | 1 |
| 7 | Usama | 4 |
Going up in the hierarchy one level: What's the name of John's boss?
| SQL | Result | Relational algebra | ||
|---|---|---|---|---|
select b.name |
| PROJECTbname ([SELECTpname = "John"(RENAMEP(pnr, pname, pmgr)(E))] JOINpmgr = bnr [RENAMEB(bnr, bname, bmgr)(E)])
PROJECTb.name ([SELECTname = "John"(RENAMEP(E))] JOINp.mgr = b.nr [RENAMEB(E)])
P <- RENAMEP(pnr, pname, pmgr)(E) |
Notes about renaming:
- We are joining E with itself, both in the SQL query and in the relational algebra expression: it's like joining two tables with the same name and the same attribute names.
- Therefore, some renaming is required.
- RENAMEP(E) JOIN... RENAMEB(E) is a start, but then we still have the same attribute names.
Going up in the hierarchy two levels: What's the name of John's boss' boss?
| SQL | Result | Relational algebra | ||
|---|---|---|---|---|
select ob.name |
| PROJECTob.name (([SELECTname = "John"(RENAMEP(E))] JOINp.mgr = b.nr [RENAMEB(E)]) JOINb.mgr = ob.nr [RENAMEOB(E)])
P <- RENAMEP(pnr, pname, pmgr)(E) |
Recursive closure
Both one and two levels up: What's the name of John's boss, and of John's boss' boss?
| SQL | Result | Relational algebra | |||
|---|---|---|---|---|---|
(select b.name ...) |
| (...) UNION (...) |
Recursively: What's the name of all John's bosses? (One, two, three, four or more levels.)
- Not possible in (conventional) relational algebra, but a special operation called transitive closure has been proposed.
- Not possible in (standard) SQL (SQL2), but in SQL3, and using SQL + a host language with loops or recursion.
Outer join
Example: The table E (for EMPLOYEE)
| enr | ename | dept |
|---|---|---|
| 1 | Bill | A |
| 2 | Sarah | C |
| 3 | John | A |
Example: The table D (for DEPARTMENT)
| dnr | dname |
|---|---|
| A | Marketing |
| B | Sales |
| C | Legal |
List each employee together with the department he or she works at:
| SQL | Result | Relational algebra | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
select *
select * |
| E JOINedept = dnr D |
No employee works at department B, Sales, so it is not present in the result. This is probably not a problem in this case. But what if we want to know the number of employees at each department?
| SQL | Result | Relational algebra | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
select dnr, dname, count(*)
select dnr, dname, count(*) |
| dnr, dnameFcount(*)(E JOINedept = dnr D) |
No employee works at department B, Sales, so it is not present in the result. It disappeared already in the join, so the aggregate function never sees it. But what if we want it in the result, with the right number of employees (zero)?
Use a right outer join, which keeps all the rows from the right table. If a row can't be connected to any of the rows from the left table according to the join condition, null values are used:
| SQL | Result | Relational algebra | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
select * |
| E RIGHT OUTER JOINedept = dnr D | |||||||||||||||||||||||||
select dnr, dname, count(*) |
| dnr, dnameFcount(*)(E RIGHT OUTER JOINedept = dnr D) | |||||||||||||||||||||||||
select dnr, dname, count(enr) |
| dnr, dnameFcount(enr)(E RIGHT OUTER JOINedept = dnr D) |
Join types:
- JOIN = "normal" join = inner join
- LEFT OUTER JOIN = left outer join
- RIGHT OUTER JOIN = right outer join
- FULL OUTER JOIN = full outer join
Outer union
Outer union can be used to calculate the union of two relations that are partially union compatible. Not very common.Example: The table R
| A | B |
|---|---|
| 1 | 2 |
| 3 | 4 |
Example: The table S
| B | C |
|---|---|
| 4 | 5 |
| 6 | 7 |
The result of an outer union between R and S:
| A | B | C |
|---|---|---|
| 1 | 2 | null |
| 3 | 4 | 5 |
| null | 6 | 7 |
Division
Who works on (at least) all the projects that Bob works on?Semijoin
A join where the result only contains the columns from one of the joined tables. Useful in distributed databases, so we don't have to send as much data over the network.Update
To update a named relation, just give the variable a new value. To add all the rows in relation N to the relation R:R <- R UNION N
Taken from:
Friday, November 7, 2008
Prof G said
Yahooo! Yay! I was going to do that anyways, but I got no one to confirm that my codes' right. Cooool. I can't wait! So excited.
Oh on another note, I might have more responsibilities on the job come January, so I am not sure if I should defer or continue with Jan semester. But that can wait. First thing first. Exams and geometry project!
Wednesday, November 5, 2008
Let's go somewhere far away.
I will go somewhere very far away. Build my own little house. Then I will kidnap you. And we will live in that little house. You will never have to care what happens to him.
A silly thought. But a silly thought that makes me happy.
Tuesday, November 4, 2008
Understand Phong and Spaces
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
VGOPHONG.TXT - Phong lighting and specular highlights. Theory,
practice and explaination of the phong lighting
and shading model.
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
by TimJ/Vertigo
"I am he, as you are he, as you are me, and we are all together"
email: tim@legend.co.uk
irc: #coders #vertcode
revision history:
16/02/97 v1.0 - Initial version
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
INTRODUCTION
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
First off, I hope this doc is of use to some people, and maybe other
people will find it interesting.
Recently, I've been thinking a lot about phong shading and lighting.
There was something that was bugging me. I couldn't quite put my finger
on it. It was something I knew to be true, but I had to explain it to
myself. It all started when I was chatting to Vector about true phong
shading. We'd both recently looked at Voltaire/OTM's doc on fast phong
shading (again).
We were (among other things) chatting about lighting functions in our
3D engine. It was about specular highlights and the way normal (fast)
phong lighting doesn't yield specular highlights on a flat plane
(all normals pointing one way). This got me thinking. I thought, well
of course it doesn't, because the light calculated at each point will be
the same (because all normals are the same). This annoyed me because I
knew it wasn't true -- but I couldn't remember why. It's all to do with
the light vector and the view vector (and keeping them constant).
Volatire's phong method also doesn't yield specular highlights in the
center of polygons. Oh, and his method emulates the equation given
exactly -- it's not a tradeoff. But then again, it's also just the
same as using gouraud. I'll explain later.
Then I remembered the actual theory behind the lighting equations. It
stuck me that people tend to get mixed up in code and forget about the
theory behind it.
What I'll do is go through the theory, how it's implemented.
Based on that I'll then address what this doc is actually about --
highlights in the center of polygons and on flat planes.
If you think this doc is a bit slow, forgive me, but you can never please
everybody :)
[Oh, important point.. this is generally about the phong equation. You
can do it per pixel or per vertex, either way it's the phong equation.
Just because you gouraud shade doesn't mean you can't have phong style
specular highlights.]
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
LIGHT RAY REFLECTION
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
I was going to explain the theory behind light ray relfection and the
spread of the ray across a surface depending on the angle of incidence.
But but then I realized I'd have to go into they physics behind spectral
reflectivity too, so I won't :)
If there's enough demand for it, email me and I'll put it in.
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
PHONG'S SPECULAR HIGHLIGHTS
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
We need to understand how the phong lighting equation is made up. Let's
define a few useful values:
^N
|
Lˇˇˇ | R V
\ˇˇ | / __/
\ˇ | / __/
\ | / __/
\ | /__/
\|//
-------------.--------------
P
^
point under consideration
It's important you know what these values actually are:
N = surface normal
L = unit vector between point and light
V = unit vector between point and view
R = light reflection unit vector (mirror of L about N)
First, the diffuse relfection is given by the Lamertian Relfection
equation:
diffuse = Kd * (N dot L)
Where Kd is the diffuse relfection constant. (N dot L) is the same as
the cosine of the angle between N and L, so as the angle decrease, the
resulting diffuse value is higher.
Phong gave spectral reflectivity as:
diffuse + Ks * (R dot V)^n
Which is:
Kd * (N dot L) + Ks * (R dot V)^n
Where Kd is the diffuse component and Ks is the specular compoenet. This
is the generally accepted phong lighting equation. Ks is generaly taken to
be a specularity constant (although Phong defined it as W(i).. see later).
As the angle between the view (V) and the reflected light (R) decreases,
you will get more specularity.
The clever thing about Phong's equation was that it gave a neat way to
calculate the specular intensity 'bump' around the light reflection
vector (R). The larger the exponential power (n) the smaller and more
intense the specular intensity bump. Hence specular highlights.
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
IMPLEMENTATION OF PHONG'S EQUATION
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
Most people simplify this equation somewhat, for speed. We begin with :
Kd * (N dot L) + Ks * (R dot V)^n
The obvious thing we'd like to remove is (R dot V). Since we don't
want to calculate the light relfection vector (mirror of light incidence
around the surface normal) -- because it's expensive. Blinn introduced a
way to do this using an imaginary vector H. It's then reduced to (N dot H).
H is defined as halfway between L and V (after L and V are normalized).
H is therefore (L + V) / 2. You will see that the angle R dot V is double
N dot H -- but this doesn't matter as you can alter the specular
exponential value (n) to compenstate. This gives us the equation :
Kd * (N dot L) + Ks * (N dot ( L + V / 2))^n
Up until now we've ignored the ambient factor, this is because it's
damn obvious and has little consequence on the math.. we'll put it in
now
Ka + Kd * (N dot L) + Ks * (N dot ( L + V / 2))^n
Which is easily implemented. You only need three vectors: the surface
normal, the light vector and the view vector. It's obviously advised
to do this equation in object-space.
Another way to remove R dot V, is by replacing it with N dot L :
Ka + Kd * (N dot L) + Ks * (N dot L)^n
This assumes you will always get the maximum specularly reflected light,
no matter where the view is. Here's why :
If we assume V is always the same as R, then the angle between N and V is
the same as N and L --
^N
| A = angle between N and L
Lˇˇˇ | R (also V) B = angle between N and V
\ˇˇA | B /
\ˇ /|\ /
\/ | \/
\ | /
\|/
-------------.--------------
Angle A and B are the same (of course, since R is the mirror vector of L).
So, N dot V becomes the same as L dot N.
This makes life easier and faster. The results completely ignore the
position of the view; so it's like having a reflective surface that always
reflects the maximum amount of specular light towards the view.
(normally, as the angle between the view and the reflected light
increases, you get less specularly reflected light).
It's just a trade off.
Ka + Kd * (N dot L) + Ks * (N dot L)^n
or
Ka + Kd * cos(theta) + Ks * cos(theta)^n
where cos(theta) is N dot L. Most likely, the above equation is the
one most people use. Also, since more implementation assume V is constant
across the scene (normalized.. at infinity) then using N dot L can be
acceptable. But it does have some dire consequences.
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
REAL TIME PHONG SHADING
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
This is what was causing the confusion. Voltaires text on phong shading
(OTMPHONG.TXT) used the equation
color = specular + (cos x) * diffuse + (cos x)^n * specular
for calculating phong lighting. This is the same as the last equation we
just disussed. He then went on to explain the specular intensity 'bump'
through the (cos x)^n term of the equation.
(note: phong shading is done by recalculating the lighting equation at
each pixel -- this is done by interpolating the vertex normals across
the polygon and re-evaluating).
Since there is just one angle term in the equation (N dot L), he realized
he could dispense with normals and just interpolate the angle.
Remember :
Ka + Kd * cos(theta) + Ks * cos(theta)^n
You only need to interpolate theta, then you can do a lookup table for
the correct colour created like so:
for( theta=0 ; theta <>
{
table[i] = Ka + Kd * cos(theta) + Ks * pow( cos(theta) , specExp ) ;
}
The problem with all this is that the original equation was inaccurate,
so the results will be inaccurate. However, Voltaire does point this
out, and state that highlights can't be inside polygons.
But, as Zog pointed out to me, you can get exactly the same effect with
gouraud, by setting up the palette in a similar way. This method is
basically the same as gouraud, you're just interpolating an angle instead
of an intensity.. as Zog put it, "it's fucking gouraud revisited" :)
I just thought I'd clear this up, as people tend not to believe it's
real, and think it's some kind of trick (if you use the same equation
in a true shader, you'll get the same results).
It's also important for the next section (the equation at least).
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
PHONG'S SPECULAR HIGHLIGHTS (REVISITED)
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
As pointed out, phong shading requires the interpolating of vertex
normals across the polygon, and recalculation of the equation.
Right, here's where more confustion comes in. To simplify things,
people tend to treat V as a constant over the entire scene.
N
L | / V (view)
(light) \ | /
\ | /
\ | /
\|/
-------------.--------------
P
V is not constant though.. it is dependant on the point under
consideration (P). So making V constant, is like sticking the view at
infinity (this is done by normalizing the view vector).
This means that the falloff of the specular light at sharp angles
between the surface and view is not taken into account (it's linear).
So the highlight will be too big and intense at sharp angles (the
falloff will be linear in respect to the view position). Also, the
highlight won't move correctly with the view.
You can probably see that the same thing can be done for L..
ie. directional lighting. Putting L at infinity affects specular fall
off with respect to the light and the view. But I'm sure everyone knows
the implications of directional lighting (it's just like having a light
really really far away).
As explained earlier, dispensing with V altogether can give you a nice
speed up using N dot L instead of R dot V.
Let's look at the consequences of dispensing with V. This is like
assuming you have a perfect reflector.. like a mirror. The surface will
always reflect the maximum amount of specular light towards the view --
the highlight will seem to 'stick' to the light relfection vector and not
change shape or size, no matter where you put the view.
But, given this, you just have to interpolate N for the polygon
(remember, we need (N dot L) and (N dot H) where is H = L+V/2)
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
SPECULAR REFLECTION
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
Now we get to the crux of the problem. All that time ago back at the
start, I mentioned a plane with all the normals pointing one way.
The thing to remember is this, the lighting is *not* just dependant on
the surface normal. It's a function of the light vector and the view
vector. The important value is V, as V affects how specular light is
reflected.
If V is properly calculated, for a flat surface, the angle between the
view and the normal (which is constant) will alter.
N
V ^
\ \ |
\ \ |
\ \ |
\ \ |
\ \ |
\ \ |
-------.-----------.---
p1 p2
The angle at p1 is obviously sharper than the angle at p2. Even though
N is the same at both points. It all becomes obvious now. Unless you
calculate V correctly, the reflected specular light over a flat surface
will be the even at any point on it.
At this point you might be thinking : "what if V is put at infinity and
L is calculated properly? -- won't that do the same job?"
In a word, no, because V is the important vector. We have to remember the
original equation where the specular light was a function of R and V.
N would be constant, V would be constant, so specular light would just be
a function of V -- ie, not very accurate at all.
So, we're left with the following equation:
Ka + Kd * (N dot L) + Ks * (N dot ( L + V / 2))^n
So, basically, in a nutshell, you've got to recalculate V for the new
point under consideration. If you do that, you'll get specular highlights
on flat planes.
If you have directional lights (L at infinity) then the highlight will be
incorrectly positioned and spread -- since the angle between any given
point and the light will be more or less the same (to an infintecial
degree). On a flat surface you'd be depending on the angle the view makes
with the surface. Although, this isn't too much to worry about --
I think directional lighting is a choice, not a compromise.
[ Oh yeah, in the first section I said Phong defined Ks as W(i). Well,
this meant that Ks was a function of the angle of incidence between
the light and the surface. So specularly reflected light was dependant
on the incoming angle as well as the outgoing angle. Phong never
actually defined W(i) though -- so it's usually ignored. It does give
you another parameter for your surface to play with though. ]
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
REAL TIME PHONG SHADING (REVISIED)
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
Ok, so now we know that V and L are important factors of the equation.
Voltaire's phong shading method is completely correct for the equation
he used (but as mentioned, it's basically the same as gouraud).
What he did was place L at infinity and make the surface a perfect
reflector (that always reflected the maximum specular light) towards
the view (where ever it was). I explained all this earlier anyway :)
That meant there was only one angle to interpolate, but it also meant
that on flat surfaces it was impossible to get correct highlights.
(polygons are flat :)
However, Voltaire's method is more accurate than normal gouraud for the
same lighting equation (due to the non-linear lookup table).
However, you can do the same with gouraud.. it just another way of
implenenting it (and quite redundant).
His method won't extend to other equations though.
What's annoying is when people just say his method doesn't work and is
a load of crap, without explaining why.
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
CLOSING WORDS
"picture yourself in boat on river with tangerine trees and marmalade skies"
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
Well, I guess I've managed to confuse almost eveyone. What I've tried
to do is explain the factors of the phong lighting equation -- what parts
do what, and why it works.
I've probably made loads of typo's and got different bit's mixed up --
but hell, I don't care :) With any luck, I might not get flamed.
If I have mixed something up, forgive me -- it get's hard to track what
you have/have not said etc.. and it's not easy without some good
diagrams :)
There are a couple of sections I've left out.. I started the one on
light ray reflection, but left it out. I also has a section on optimizing
the equation :
Ka + Kd * (N dot L) + Ks * (N dot ( L + V / 2))^n
But I didn't get it finished (it's based on the routines I use in my
3D engine). There are no square roots, tables, divides or pow()'s used.
Yet it still produces the same results (to a reasonable degree of
accuracy -- any errors are covered up by (a). the number of intensities we
can actually display and (b). the precision of the fpu).
If there's enough demand then I'll put it in.
At the end of all this, an interesting thing to note is that all these
equations have no physical basic what so ever -- they're just equations
that fit real work observations. Light is actually better represented as
radiation -- but let's not get into that now :)
Greets:
Oh god, I don't know.. um.. people I know.. hmmm
(no particular order)
Vector
Vastator
Phred
Gooroo
Midnight
aM
Eckart
codex
PGM (where ever he may be)
BigCheese
Pel
Wog (Zog, whatever)
Crom
God
All at Abstract Entertainment
[plus anyone I've missed]
Flames/comments go to: tim@legend.co.uk
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
"Living is easy with eyes closed. Misunderstanding all you see.
It's getting hard to be someone, but it all works out. It doesn't matter
much to me."
Monday, November 3, 2008
The beginning
I don't want to see uniforms again. It was funny before. Now the joke is stale."
No tears. My heart just bleeds. You hurt me bad. I cannot even begin to understand this pain.
Sunday, November 2, 2008
FANTASTIC Explaination and Picture on Eye, World & Object Space
http://www.cs.cmu.edu/~djames/15-462/Fall03/notes/CassEveritt-MathematicsOfPerPixelLighting.pdf
However, in OpenGL, there's only 2 spaces:
1. ModelView: Object
2. Projection: Eye (or camera)
OpenGL has no explicit world space.
From OpenGL.org:
Think of the projection matrix as describing the attributes of your camera, such as field of view, focal length, fish eye lens, etc. Think of the ModelView matrix as where you stand with the camera and the direction you point it.
For the specular lights, we will need the inverse matrix to compute the camera view. However OpenGL matrix is column major. So beware!
Here is one good read on Matrix, OpenGL style.
MacTech: Macintosh Technology has a simple reading for texture gen and texture mapping.
My lighting algorithm was right as far as mathematics is concerned but I did not care about the Eye and View Space that I got them all topsy turvy. From OpenGL Forum:
+--------------+ +--------------+
| Object Space | -> Modeling Transform -> | World Space |
+--------------+ +--------------+
+--------------+ +--------------+
| World Space | -> Viewing Transform -> | Eye Space |
+--------------+ +--------------+
+--------------+ +--------------+
| Object Space | -> Modelview Transform -> | Eye Space |
+--------------+ +--------------+
The modelview matrix gets you from object space to eye space (use the inverse to get back). It doesn't know about world
space.
The only way you can use modelview to get back to world space is if your object space and world space are the same (i.e. your modeling transform is the identity matrix -- i.e. a no-op). in other words, if the position vertex data for all objects in your scene are specified in a common coordinate system.
You're probably goin to find it simpler to pre-transform your light to eye space in your app and pass that into your shader, so you don't have to think about world space in your shader.
Saturday, November 1, 2008
Semester Break
For Self:
1. Wax!
2. Threading. I can see a layer of mustache!
3. Yoga
4. Facial
5. Finish those BS sessions in Orchard.
6. Check camera & equip. Store properly.
7. Clear old lecture notes from bag. Store properly.
For Room:
1. Clean study. Setup dual monitor for mac & Dell. Buffer & speakers.
2. Rearrange furniture. Throw that ugly brown thing out. New room decor! ^_^
3. Clear clothes closet. Throw or give away clothes. Send dresses for dry clean.
4. Buy shoe compartment (Ikea). Throw or give away shoes. Send shoes for mending.
5. Vanity table. Clear old makeup. Put everything properly in their storage boxes. Some new storage compartments from bkk and tky. Need more storage? Ikea or Daiso.
Haiz... Unpack from trips.
Bring unwanted storage boxes home to mum.
Check out:
1. Tesco for home stuff & clothes(?)
2. Raid Harris bookstore for graphic books.
3. Is the Ikea near mum's opened yet?
For sg home:
1. Buy and fix the toilet seat. Dark blue.
For Friends:
1. Copy all pics from my camera for Apie.
2. Pack and label the stuff I've got for Apie & Iqbal.
3. Work with Thomad on his "Project Runway"? -- Let's discuss. Can we finish sewing classes in Dec only? Confirm that.
Need Thomad to: mend my necklace. teach me how to use the tiny sewing machine.
4. Pictures for Celine and Li Ting.
Question:
Where's my Ikea membership card? Find it.
Lights & Rays by Phong
Oooh... Dr Phong. I will study your algo and make the darn lights lit!
Basic Light Model
surfaceColor = emissive + ambient + diffuse + specular
All about lights:
- diffuse = object_diffuse * light_diffuse / (distance_to_object * angle)
- ambient = object_ambient * light_ambient
- emissive = object_emissive
- specular = object_specular * light_specular : with size of reflection determined by object_specular_power and distance_to_object and the position of the reflection based on angle.
- final_color = (diffuse + ambient + emissive) * object_texture + specular : with the sum of diffuse, ambient and emissive capped at (1.0, 1.0, 1.0)
BASICS DETAILS OF LIGHTING:
http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter05.html
More Texture Mapping
http://www.informit.com/articles/article.aspx?p=770639&seqNum=4
Perspective Correct Texture Mapping. Back to basics of U V from X Y
http://easyweb.easynet.co.uk/~mrmeanie/tmap/tmap.htm
Some simple TRIGO maths:
http://www.ies.co.jp/math/java/trig/
! year
Woah. Feels like forever.
How was I like 1 year ago? I cannot remember.
But I know I was not depressed. I know I was all sunshine and rainbow. And very excited.
But... but the people here... They're constantly stern and looked constipated all the time.
Thomad said last week, "You have not smiled in a long time, have you? You are all frowns." I guess... I am not sure. I don't remember who I used to be. I just know who I am now.
I am tired and getting nowhere.
I guess that is what this place do to you.
Wednesday, October 29, 2008
How does it feel to have a normal life?
Why?
Oh I can't explain the whole thing. Just call her. She is not emotional at all. I think she is keeping everything inside. She will burst if she continues like that.
Ok. I will call her now.
I was thinking hard. How do I call her and make her tell me these things without letting her know I am aware of it?
Hello, Ma. Sorry about yesterday. My flight was delayed. So I came back really late.
You were away for days and not even one phone call!
I am sorry.
Oh nevermind. So many things happened in those few days. Your brother has been locked up. Since Saturday night. The police came and handcuffed him away. I am not going to care this time. You hear me? I don't care anymore. I didn't even go see him. Until this morning when dad's friend beg me to. Why should I? I am not praying for him either. Let him be. Let him feel it.
She sounds angry.
What is the story this time? Oh... that... Well you know what? I think he deserves it. It's karma. I believe in it. He should too. We don't get away all the time if we are not good people. That is what I think.
Ya. Let him stay there for some time. He needs to learn on his own. We can't keep rescuing him. You know that place is really new and clean? I went there, and they were very fast. I just gave them my name and the person I want to see, in half an hour, they escorted him out. If it was the old place... takes a full day and you don't even get to see his shadow. Just keep telling you to wait. Apparently visitors can bring food for them. I saw the rest of the families came with food. I did not. I asked but he said he is getting meals. So I guess it's ok. The hearing keeps getting delayed. One moment they said it's on the 7th, then the next it's on the 20th. They're just looking for an empty slot for him.
Ok.
I didn't ask her how she felt because I can guess. She is angry and dissappointed. She has given up on him.
Oh. I have an incoming call. Talk to you later, alright?
This is our lives. This is how drama it is. We've learned to become very detached, emotionless because we have to deal with it. But it's not fair, is it?
Why don't I have a normal life? Why can't I just have a normal life?
And why can't I cry? This is huge. This is bad. And I can't cry. I am not able to cry when things get seriously fucked up. I'm just calm and logical. And I do what I have to do. I become a robot. I am not even sad. Luigi asked me if I am sad. I said no. I don't expect anything less from him.
But why don't I feel anything? I don't feel sad. I just don't feel anything! Strange thoughts came to my head. Like I am glad he has so many tattooes because he is such a pretty boy without them. Pretty boys don't last in the cell. Pretty boys become their play things. Pretty boys get raped.
Why's everyone so shocked and more emotional than me? I just don't get it. Luckily I can still cry. At stupid, useless things.
If I don't, I am most probably a real robot and I don't think I like the thought of that at all.
I thought about how we were as kids. Where did it start to go wrong? Sometimes, just sometimes, I feel like walking in front of a car. I am not suicidal or anything. I just feel numb. But then the thought of my mum being sad stop me from doing that. So I just continue with this numbness and crying over small things.
Oh... and I torture myself with work and school.
Had a huge migraine this morning. Saw a doctor who prescribe the migraine pills but also gastric pills because the former will cause gastric.
Such is the irony of life.
Tuesday, October 28, 2008
Biologically Inspired Model
Anyways was telling Apie about this. The thought that came to both our minds were, "Oh we can collaborate!"
She is in brain research and I can do this from computer engineering point of view. Inspire me to want to graduate and finish school.
Saturday, October 25, 2008
Want to read these books
I don't ever want to be a game programmer. But I am having too much fun
and of course, definitely:
Flatland by Edwin Abbott. So funny, about 2D and 3D mathematics.
A Wrinkle in Time by Madeline L'Engle
Ender's Game by Orson Scott Card
------- still compiling the list.
Tuesday, October 21, 2008
Sad day: Setup Visual Studio 2005
Related to Lighting
http://jerome.jouvie.free.fr/OpenGl/Tutorials/Tutorial12.php
Basic readings for 18 lights & shadows
http://www.opengl.org/resources/faq/technical/lights.htm
http://www.dgp.toronto.edu/~patrick/csc418/notes/tutorial6.pdf
Related to Texture
http://resumbrae.com/ub/dms423_f07/14/
Could be useful in our texture tile:
http://www.opengl.org.ru/docs/pg/0902.html
Download & read this:
http://www.cs.tcd.ie/courses/baict/bass/4ict10/Hillary2003/pdf/Lecture6_27Jan.pdf
http://www.nullterminator.net/gltexture.html
Step by step to texture tiling:
http://www.meandmark.com/tilingpart1.html
Simple drawing to a texture:
http://steinsoft.net/index.php?site=Programming/Code%20Snippets/OpenGL/no9
Detailed Textures...but Java?
http://jerome.jouvie.free.fr/OpenGl/Tutorials/Tutorial5.php
Simple to understand texturing:
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=246959
Texture Mapping Tutorial Framework, Reread this!
http://gpwiki.org/index.php/OpenGL:Tutorials:Tutorial_Framework:Texture_Mapping
Misc:
Hidden view
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_offscreen/chapter_5_section_3.html
Mac idiosyncrasies
glTexSubImage2D v. glTexImage2D
"On the Mac it was necessary to make the glPixelStore*() calls before invoking both glTexImage2D() and glTexSubImage2D() -- I now make those calls before every invocation."
Monday, October 20, 2008
Calculating Normals
http://www.spacesimulator.net/tut5_vectors_and_lighting.html
Game Programming Wiki: gpwiki
Good Matrix & Vector FAQ: http://www.j3d.org/matrix_faq/
Now, please! Will you guys quit disturbing me so I can graduate and work in a sweatshop like Blizzard?
Saturday, October 18, 2008
Let's Just Be Friends
You say: Let's just be friends.
I say: Aren't we already?
You say: I don't want to get married.
I say: Neither do I.
You say: This can't go on. I know you do.
I say: It's not important.
You sob: I am sure you can find someone more worthy of you.
I choke: I've found you.
You plead: You know I love you.
I mutter: I never stop telling you.
You wonder: How sad are you?
I answer: I don't know.
You whisper: Please don't cry.
I weep: I can't stop.
I muse: I will never find someone better than you.
You brood: I will never find someone madder than you.
We hug.
To you, my mouth braves, I am alright.
To me, my mind breaks down, I am abandoned.
To you, I smile cherrily.
To me, I smile woefully.
If you're even slightly capable
Damn... I've been working average 12 hours a day and weekends!
I really need to do my laundry. I've ran out of underwear.
-ND
"Huh? Ah! Hahaha!"
A dream within a dream
And, in parting from you now,
Thus much let me avow-
You are not wrong, who deem
That my days have been a dream;
Yet if hope has flown away
In a night, or in a day,
In a vision, or in none,
Is it therefore the less gone?
All that we see or seem
Is but a dream within a dream.
I stand amid the roar
Of a surf-tormented shore,
And I hold within my hand
Grains of the golden sand-
How few! yet how they creep
Through my fingers to the deep,
While I weep- while I weep!
O God! can I not grasp
Them with a tighter clasp?
O God! can I not save
One from the pitiless wave?
Is all that we see or seem
But a dream within a dream?
Edgar Allan Poe
Friday, October 17, 2008
An ode to Space Invaders
Even though it was actually a bird hunting game, her description reminded me of space invaders. So I told her she should name it that. Totally strange but quite funny.
Space invaders is the only game I like on our Atari 2600. My bro is pretty good in all the games but not me. I will start scratching my face because my Mario just can't jump high enough to get the mushroom. But I like space invaders. It's the only one game I am actually good at.
Sounds like a long time ago? Yes, it is a long time ago...
The other day we were playing Wii and Xbox 360.
Reminds me of so many things... because I am not as l33t as him, this is all I can say when he told me he had a Commodore. I gave him my heart and 7 (or was it 8? or 11?) years of my youth.
Wearing my heart on the sleeve
But there's one person who could make me cry with the snap of his fingers. Today, he made me cry again. And I cried. And cried. And cried.
Do I seem weak because I cry?
It feels so good to cry. There's so many things in my life that I should cry about and I never did.
I can't stop crying because he has this power over me.
Let there be tears!
And I obey. I cry for everything that I should but never.
I cry because I am depressed at work.
I cry because I feel useless.
I cry because I am disappointing.
I cry because I am in pain.
I cry because I miss mum. And pa. And pa...
I cry because my heart is in pieces.
I cry because I am tired.
I cry because I cannot pretend anymore.
I cry because this is really how I feel.
I cry because I have no friends.
I cry because I am sorry for how it all turned out.
I cry because I realised all the above.
I cry because I don't cry much at all. In the end, I just want the tears to keep on flowing. I cry because I need to.
Wednesday, October 15, 2008
They want the sofas!
Hello?
And what? Giving us a leather couch and $300 dollars to get something?
I can disagree, you know. It's a breach of contract. I don't like leather couch. They make my ass sweat.
Excuse me. I don't think that is right. We have a 9 seater sofas and 2 coffee tables. How's that fair? Just because there's only two of us in the house doesn't mean we don't need all the sofas! For all they know, we are having gang-bang parties every other weekend and we need all these sofas.
Sunday, October 12, 2008
I hate reading!!!
Wait. I never want to be a researcher!
Yucks!
****************
Extract from Meebo Blog.
There's an entire system of measurement that's almost exclusive to typography (1 inch = 6 picas = 72 points; ems and ens depend on the size of the font), and entire vocabulary to describe fonts and layout (kern, glyph, serif, dingbat, recto, verso, ligature).
It's all a bit pretentious, it's true, but art students are used to that. One of the more pretentious constructs is the colophon - a page at the back of some nicely designed books that describes the typography and production processes used for that book. In closing, I offer a colophon for meebo:
Meebo's logotype is set in Monotype's Arial Rounded, a sans-serif font designed in 1993 by Robin Nicholas and Patricia Saunders. Text type in meebo.com is Tahoma, a humanist sans-serif font designed in 1994 for Microsoft Corporation. Logo colors are Pantone 151 and Pantone 647. Meebo.com was launched in 2005 and is produced using JavaScript, Python, and C. Production systems run Linux.
****************
Ho ho... I actually pay attention to this kinda crap.
Tuesday, October 7, 2008
My half of the biscuit!
He: What cookie?
Me: I ate half of a cookie and kept the other half for my journey to Mordor. Wrapped in a tissue. It's elven cookie. You only need to eat very little and it will give you enough energy.
He: I guess now you will be eaten by orcs.
Me: Where's the other half of the cookie? *search everywhere*
...
He: I threw it out.
Monday, October 6, 2008
Ray Tracing
Sunday, October 5, 2008
All about Matrix
REMEMBER!
AB != BA ==> matrix multiplication is not commutative.
Cols in A == Rows in B (right, down)
Inverse
For a matrix M to have an inverse, it's determinant |M| != 0.
Given M is a 2x2 matrix.
m1 m2
m3 m4 = M
3 2
6 4 = M
det[M] = |M| = (m1)(m4) - (m2)(m3) = (3)(4) - (2)(6) = 0 QED
!! Remember this arrowing only works till 3x3 matrix. Anything more will need to manually compute. Will come back to this.
Matrix inverse
M-1 = 1/ |M| x (adjoint M)
... Crap... So hard to draw matrix. Ok Nvm. Come back to this later.
Mathworld Wolfram does a better job explaining it. Here: http://mathworld.wolfram.com/MatrixInverse.html
Ok... I should not spend so much time on this. Gotta hand in computer vision assignment in 10 days. Come back to this later.
Yum Char: Discussions over dim sums
Talked. Mostly on computer graphics, computer vision, AI and machine learning. Even in the computer engineering field, there's so many different classifications. We had a lot of ideas for a lot of things. We just need to sleep less to get things done.
Also, Quark and I come from the same school of thought. At least I am not alone. One of the first thing we have to realise as grad candidates is the fact that we are... grad candidates. So we have to think like researcher and less about application. However, I do not believe in wasting my time on things that is not useful in life. Quark agrees with me. We're more of the bottom-up than top-down people. Cool. Well, he finished his Masters way back and he still thinks like this.
Anyways, tried the annotation joke about Web2.0 on him. He totally gets it! Lol. I tried it on my colleague a few days ago. Fell flat.
So good talking to someone who understands what I am doing now!
I tried with some of my colleagues but heck, they don't even have a strong grasp of telco knowledge. Wait. that is not true. The only idiots I've met are all from this company. Oh well enough of that.
Anyways one of the idea we had was how to convey mathematical theorems and algorithms in human language. The tv series NUMB3RS did that moderately well. (I have the hots for Prof Eppes but that is another story altogether).
Here is a site: http://www.weallusematheveryday.com/tools/waumed/home.htm, deriving the whole idea from NUMB3RS to teach maths. I think it's alright. But definitely worth a visit.
Season:
2: Episode 14 - Harvest -- Hidden Markov Model.
Markov Chain Links - predicting probability of certain states in the future from what we know of the present. (Ex, was the weather yesterday: sunny, cloudy or raining. therefore what's the probability that it will rain today?)
Hidden Markov Model - In the event when we are not able to observe the actual state but only the outcome that is connected to the state by a certain probability distribution. (extend from above example, we do not know if it rained yesterday but the sales of umbrellas for yesterday was high).
Wednesday, October 1, 2008
Yuki Isoya's Seeds of Happiness
My addiction and studying music. Her youtube mv's all been removed.
But I found the song again in imeem. DON'T LEAVE ME AGAIN!
Her other music list.
http://www.imeem.com/artists/yuki/?arpa=t
Sunday, September 28, 2008
School: To do
Read all the 3 research papers even if you don't understand at first.
Understand all the maths from CG. Do a write up.
STOP:
Stop watching youtube so much.
Stop sleeping so much.
Stop playing with your hair.
Stop being lazy.
Thursday, September 25, 2008
Representing 3D on 2D
Therefore, besides the X and Y axis, the Z axis is utilised for perspective control (orthogonal and modelview, will come back to this in a moment); ex: Z_near, Z_far.
Initially on my GL assignment I made the mistake of drawing my ground plane on X & Y axis, causing all my models to seem like they're stuck on their side to the wall. Wrong! Should draw the ground plane on the X and Z axis!
When drawing & loading model vertices, always remember... counterclockwise to look at the front side. Right hand rule.
CG works by: modelling --> animating --> rendering.
Texture mapping= rendering the surface without requiring additional polygons to represent minute details.
Coordinate system
This I gotta find out more: model space, world space, eye space, normalised projection space, normalised device space, image space.
2D TRANSFORMATION
translation
rotation
scaling
homogeneous coordinates
composite transformation
Rigid Motion (Euclidean Transformation) preserves the distance and angle : Identity, Translation, Rotation. ∴ Shape and orientation does not change!
Linear Transformation: Identity, Rotation, Scaling, Shearing, Reflection.
Affine Transformation: add translation to linear transformations ∴ giving us affine transformation.
3D TRANSFORMATION
homogeneous coordinate
translation, scaling
rotation
composite transformation
change the orthonormal basis
3D Affine Transformation Matrix... absolutely beautiful. Draw it tomorrow.
3D Viewing and Projection
World to Eye Coordinate Transformation
Eye Coordinate System
(related to orthonormal basis)
Grr... Projection Transformation.
2 types of projection: perspective & parallel. The key factor here is COP (Center Of Projection). If projection plane is finite == perspective. Infinite projection plane == parallel.
*****Will come back and finish this. Now I need to sleep. And have mathematical nightmares.
Oooh... I need to come back to these:
http://www.faqs.org/faqs/graphics/algorithms-faq/
http://kesen.huang.googlepages.com/
Tuesday, September 23, 2008
Maths: Binormial Co-efficient
(ni) = n! / i!(n-i)!
Binormial theorem
(x + y)n = ∑ni=0 (ni) xi yn-i
in relation to FFD:
conventional polynomial basis: 1 t t2 t3
Bernstein polynomial basis: (1-t)3 3(1-t)2t 3(1-t)t2 t3
1-D example (real line)
given an arbitrary point, v, on a line of P0, P1, P2, P3.
P0=0
P1=1
P2=2
P3=3
v is given as x. t is given as the length of v to P0 divided by P3 to P0.
in general mathematical terms:
v = ∑ 3i=0 P i W i (t)
W = weight = scalar = constant
in this context:
t= ||v P0|| / ||P3 P0|| = x/3
∴ using dot product:
v = 1 • W1(t) + 2 • W2(t) + 3 • W3(t)
(P0 is ignored because P0=0; where the multiplication will results in 0)
= (31)t1 (1-t2) + 2 • (32)t2(1-t) + 3 • (33)t3
= 3t (1-t2) + 6 t2(1-t) + 3 t3
=3t [ (1-t)2 + 2t(1-t) + t2 ]
=3t [ (1-t) + t ] 2 = 3t = x
Monday, September 22, 2008
I've spent 2 hours searching for this post!!!
Free Form Deformation
1. FFD:
Sederberg's paper (1986)
http://www.gamasutra.com/view/feature/3372/realtime_softobject_animation_.php
http://web.cs.wpi.edu/~matt/courses/cs563/talks/freeform/free_form.html
http://www.cs.unc.edu/~hoff/projects/comp239/finalproj/ffd/ffd.html
2. Redbook: chapter 13
3. Polynormial, binormial??? <-- What is this??? FIND OUT!
http://en.wikipedia.org/wiki/Binomial_theorem
NOTE:
Redbook: TOC
OpenGL Matrix
-- http://www.morrowland.com/apron/tutorials/gl/gl_matrix.php
-- http://lists.apple.com/archives/mac-opengl/2000/Dec/msg00036.html
-- http://gpwiki.org/index.php/OpenGL:Tutorials:Theory
-- http://qa.techinterviews.com/q/20060803025430AAvfBIl
-- http://www.sjbaker.org/steve/omniv/matrices_can_be_your_friends.html
That darned euclidean spaces:
http://www.euclideanspace.com/threed/rendering/opengl/index.htm
GL transformation:
http://www.opengl.org/resources/faq/technical/transformations.htm
Linear algebra:
http://groups.csail.mit.edu/graphics/classes/6.837/F04/lectures/linear_algebra.ppt
Some random GL stuff:
http://bcook.cs.georgiasouthern.edu/eclass/cs/lesson8.htm
All these and then some:
vectors, matrices, and then dot product, cross product,
a little trig (sin(), cosine(), tangent()), Polar Coords and Cartesian
Coords. I'm sure I've left something out. It's not too bad. For me,
its been just sheer determination. Oh, and understanding how
OpenGL lays out its matrices.
dot product = scalar product
cross product = vector product
(1) A dot product is an example of an inner product, and is
sometimes called the "standard inner product". If U and V
are n-by-1 vectors, then the dot product is Transpose(U)*V.
If M is a positive definite matrix, then Transpose(U)*M*V is
also an inner product. In index summation notation, if the
components of U are named u_i and the components of V
are named v_j, the dot product is u_i v_i. The repeated
index means sum over it, so
u_i v_i = u_1 v_1 + u_2 v_2 + ... + u_n v_n.
If M has entries M_{ij}, then an inner product is
u_i M^{ij} v_j. The repeated i and repeated j mean sum over
both. If M is the identity matrix, you get the dot product.
For other M, you do not. This concept shows up in conjugate
gradient methods when searching for minimum values of
functions.
(2) A cross product is one example of an outer product, but
the term outer product is quite general in the world of tensors.
The permutation tensor is e_{ijk}, which is 1 if (i,j,k) is an
even permutation of (1,2,3), -1 is an odd permutation of
(1,2,3), and is 0 otherwise (when an index occurs twice). For
example, e_{123} = 1, e_{132} = -1, and e_{112} = 0. The
cross product of U and V is vector W, where n = 3 and
w_i = e_{ijk} u_j v_k
The j is repeated, so you sum over it. The k is repeated, so
you sum over it. The index i is "free" to vary, so the end result
is a singly indexed quantity (a vector).
In 2D, a vector perpendicular to U is vector W,
w_i = e_{ij} u_j
where e_{12} = 1, e_{21} = -1, e_{11} = e_{22} = 0. The
index j is repeated, so you sum over it. The "dot perp" of
U and V is a scalar
d = e_{ij} u_i v_j
Sums occur over i and j.
In 4D, a vector perpendicular to U, V, and R is vector W with
w_i = e_{ijkm} u_j v_k r_m
The rules for e_{ijkm} being 1, -1, or 0 are similar to other
dimensions. Sums occur over j, k, m. Index i is free to vary.
Another outer product of two n-by-1 vectors U and V is
U*Transpose(V), which is an n-by-n matrix. The outer
product using indices is u_i v_j. No index is repeated, so
there are no sums (n choices for i, n choices for j, total
number of choices is n*n). This concept shows up
in projection matrices. If N is a unit-length normal vector
for a plane through the origin, the projection matrix onto the
plane is P = I - N*Transpose(N).




























