It is quite new technology.
You can download the manual Here:http://download.nvidia.com/developer/cg/Cg_Users_Manual.pdf
Jay is a game developer.

import javax.vecmath.*;Hopefully someone who will use this likes to understand how it works, before use it. And anyone might be able to improve the acos and square root parts, because they are expensive calculation.
public static Vector3f refract( Vector3f rayDir, Vector3f n, float indexRatio ) {
//assert (isNormalized( rayDir ));
//assert (isNormalized( n ));
assert (0 != indexRatio);
// Ni * Sin(I) = Nr * Sin(O); Snell's Law
// sinO = sinI / degree ; where indexRatio = Nr / Ni
// we need to know the angle R; where R = I - O
//
// rotate rayDir degree by the vector calculated by crossProduct(n,rayDir)
// q = cos(R/2), cross.x * sin(R/2), cross.y * sin(R/2), cross.z * sin(R/2)
// P' = qPq' ; Using Quaternion
final float cosI = n.dot( rayDir );
// assert (cosI <= 0f && cosI >= -1f);
if( cosI >= 1f || cosI <= -1f ) return new Vector3f( rayDir ); // straight final float sinI = (float) Math.sqrt( 1 - cosI * cosI ); final float sinO = sinI / indexRatio; if( sinO > 1f ) return null; // over angle, this should be treat as reflection
final float R = (float) (Math.acos( sinI ) - Math.acos( sinO ));
assert (false == Float.isNaN( R ));
final Vector3f cross = new Vector3f();
cross.cross( rayDir, n );
assert (false == Float.isNaN( cross.x ));
assert (false == Float.isNaN( cross.y ));
assert (false == Float.isNaN( cross.z ));
final Quat4f q = new Quat4f();
final AxisAngle4f axis = new AxisAngle4f( cross.x, cross.y, cross.z, R );
q.set( axis );
final Quat4f q2 = new Quat4f( q );
q2.conjugate();
final Quat4f P = new Quat4f( rayDir.x, rayDir.y, rayDir.z, 0 );
q.mul( P );
q.mul( q2 );
final Vector3f rst = new Vector3f( q.x, q.y, q.z );
//assert (isNormalized( rst ));
return rst;
}
One thing which is very contradict is that according to the Dangun legend every body are one family. Now Korean has strong idea that every Korean in history had shared the Dangun legend after BC 2333. If it is true, then 500 years ago a Korean slave could insist my ancestor is same with my owner's ancestor. But it is obviously true that the hierarchy system in Korea history based on the different linage idea; A noble's blood is totally different from that of slave. If a slave had insisted it, he might be executed in public. One idea refers everybody is one family, and another idea refers we have different ancestor. How could it happen?
I don't know the exact meaning of 'Blacklisted' in China. I guess she cannot be in any movie in China anymore, according to the whole article; kind of expelling.
But once I tried to use in my Graphics Project, it didn't work. The reason was that I have used external library such as SWING and vecmath libraries.
In short-term, the project justifies that China combines many different minority tribes around northern part of North Korea. They want to alleviate high tense among minorities, enforcing nationalism.






Question: What is the reason for this riot?
I found a more interesting information. Google is also preparing a similar service called GDrive. I may be able to share free storage on GMail with GDrive. World is getting convenient.
First of all, they make a certain amount of contents, and they want to let all of students know all of the contents. It is their original goal. In this sense, theoretical model is everybody gets 100 point, which looks all of them become same. If some of students failed to get 100 point, then it means a instructor need to teach them, to let them know all. Exam is feed back system to educate.