Sunday, April 19, 2009
VR: Stereoscopic Projection - parallax problems
On horizontal & vertical parallax.
http://local.wasp.uwa.edu.au/~pbourke/exhibition/vpac/theory.html
http://local.wasp.uwa.edu.au/~pbourke/exhibition/vpac/theory.html
Sunday, April 12, 2009
Music to listen to while you're studying
And perhaps the neighbours are noisy and you needed to cancel them out, or you just don't want to fall asleep.
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:
http://www.amazon.com/Music-Listen-While-Youre-Studying/lm/CTMB4VPEAPU9
http://www.amazon.com/Trippy-chill-stoner-music/lm/1VQIBDTM9AQMU
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.
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
http://www.amazon.com/Trippy-chill-stoner-music/lm/1VQIBDTM9AQMU
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
In the classical animation framework, they're 4 models; 2 stimulus and 2 response.
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/
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
Beginner's 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
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
http://www.clarku.edu/~djoyce/trig/identities.html.
for derivatives, look at the Calculus part or the table of derivatives.
for derivatives, look at the Calculus part or the table of derivatives.
Sunday, March 29, 2009
Saturday, March 28, 2009
Timestep integration
http://www.euclideanspace.com/threed/games/options/timestep/index.htm
Very good to get the basics of time step transformation.
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
Slides from Cornell:
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/
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
Subscribe to:
Posts (Atom)