space_minimal.cpp
Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include<vcg/math/base.h>
00003 #include<vcg/space/point3.h>
00004 #include<vcg/space/point4.h>
00005 #include<vcg/space/color4.h>
00006 
00007 using namespace vcg;
00008 // The shortest, simplest, dulliest introduction to the VCG Library
00009 int main(int argc, char *argv[])
00010 {
00011   printf("Hello Library!\n");
00012 
00013   // classical point types. 
00014   // Point3f is just a typedef for Point3<float>
00015   Point3f pp0(0,1,2);
00016   Point3f pp1(2,1,0);
00017 
00018   // classical overloading of math operators
00019   Point3f pp2=pp1+pp0;
00020 
00021   //you can access to the components of a point with three different access methods
00022   // [0] [1] [2]            <-- Preferred style
00023   // .X() .Y() .Z()
00024   // .V(0) .V(1) .V(2)
00025   printf("pp2: %f %f %f \n",pp2[0], pp2.Y(),pp2.V(2));
00026   
00027   // Warning no implicit casts between different types
00028   // Conversions are explicit
00029   Point3i ppi=Point3i::Construct(pp1+pp0);
00030   
00031   Point4i size(0,0,1,1);
00032   
00033   // Colors are specialized Point4<unsigned char> 
00034   // with a specialized constructor 
00035 
00036   Color4b cb(Color4b::LightBlue);   
00037   Color4f cf(Color4f::LightBlue);
00038 
00039   Color4b cbi; cbi.Import(cf);
00040   printf("ci %i %i %i %i\n",cbi.V(0),cbi.V(1),cbi.V(2),cbi.V(3));
00041   return -1;
00042 }


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:36:02