Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ExampleShowFreeD.cpp
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 /** @example ExampleShowFreeD.cpp
26  * @relates ThreeDOut
27  @ingroup g_examples
28  @brief Example for ThreeDOut object, writes a wrl with a PMatrix
29  @author MIP */
30 
31 
32 #include "Utils/ThreeDOut.hh"
33 using namespace std;
34 using namespace BIAS;
35 
36 int main(int argc, char* argv[])
37 {
38  if (argc<2) {
39  BIASERR("too few arguments.");
40  return -1;
41  }
42  ifstream ifs(argv[1]);
45  ThreeDOut T(p);
46  int i=0, j = 0;
47  while (ifs.good()) {
48  PMatrix P;
49  if (P.BBCIn(ifs)!=0) break;
50  cout<<".";
51  if (i++ == 10) {
52  RGBAuc color(255,255,255,0);
53  if (j++==1) {
54  color[1]=0;
55  color[2]=0;
56  }
57  T.AddPMatrix(P,640,480, color,0.05);
58  i=0;
59  }
60  }
61  ifs.close();
62  cout<<endl;
63  T.VRMLOut("test.wrl");
64  return 0;
65 }
class RGBAuc is asynonym for a Vector4 of corerct type
Unified output of 3D entities via OpenGL or VRML.
Definition: ThreeDOut.hh:349
configuration struct for drawing styles of various 3d objects
Definition: ThreeDOut.hh:309
int BBCIn(std::ifstream &ifs, const double &AddCenterPointShiftX=0.0, const double &AddCenterPointShiftY=0.0)
Load next piece of calibration data from an open BBC-Free-D file.
Definition: PMatrix.cpp:917
CameraDrawingStyle CameraStyle
Definition: ThreeDOut.hh:313
describes a projective 3D -&gt; 2D mapping in homogenous coordinates
Definition: PMatrix.hh:88