Subversion Repositories gelsvn

Rev

Rev 107 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 107 Rev 195
Line 27... Line 27...
27
*/
27
*/
28
void example2()
28
void example2()
29
{
29
{
30
	// Create a null vector
30
	// Create a null vector
31
	Vec3f p;
31
	Vec3f p;
32
 	p.set_spherical(0.955317, 3.1415926f/4.0f , 1);
32
 	p.set_spherical(0.955317f, 3.1415926f/4.0f , 1.0f);
33
	cout << " p = " << p << ", p.length() = " << p.length() << endl;
33
	cout << " p = " << p << ", p.length() = " << p.length() << endl;
34
}
34
}
35
 
35
 
36
void example3()
36
void example3()
37
{
37
{
Line 57... Line 57...
57
}
57
}
58
 
58
 
59
 
59
 
60
void example4()
60
void example4()
61
{
61
{
62
	Vec3f p1(0.8660,.4,-.3);
62
	Vec3f p1(0.8660f,.4f,-.3f);
63
	Vec3f p2(-0.8660,.4,-.3);
63
	Vec3f p2(-0.8660f,.4f,-.3f);
64
	Vec3f p3(0,.7,-.7141);
64
	Vec3f p3(0.0f,.7f,-.7141f);
65
 
65
 
66
	Vec3f n1 = cross(p1,p2);
66
	Vec3f n1 = cross(p1,p2);
67
	Vec3f n2 = cross(p2,p3);
67
	Vec3f n2 = cross(p2,p3);
68
	Vec3f n3 = cross(p3,p1);
68
	Vec3f n3 = cross(p3,p1);
69
	Vec3f n  = normalize(n1+n2+n3);
69
	Vec3f n  = normalize(n1+n2+n3);