⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coinhistory.cpp.in

📁 学习 open inventor 的例子
💻 IN
📖 第 1 页 / 共 5 页
字号:
/**************************************************************************\ * *  This file is part of a set of example programs for the Coin library. *  Copyright (C) 2000-2003 by Systems in Motion. All rights reserved. * *                   <URL:http://www.coin3d.org> * *  This sourcecode can be redistributed and/or modified under the *  terms of the GNU General Public License version 2 as published by *  the Free Software Foundation. See the file COPYING at the root *  directory of the distribution for more details. * *  As a special exception, all sourcecode of the demo examples can be *  used for any purpose for licensees of the Coin Professional *  Edition License, without the restrictions of the GNU GPL. See our *  web pages for information about how to acquire a Professional Edition *  License. * *  Systems in Motion, <URL:http://www.sim.no>, <mailto:support@sim.no> *\**************************************************************************//* ********************************************************************** * * coinhistory * * Demo application for showcasing Coin. * * Written by Thomas Hammer <thammer@coin3d.org>. * Some code borrowed from earlier Coin competition entries. * * ********************************************************************** */// FIXME: causes a crash when running on top of SGI Inventor with this// backtrace:////  #0  0x4047740e in SoOutlineFontCache::getFont ()//     from /usr/local/sgi-inventor/usr/lib/libInventor.so//  #1  0x4047622c in SoText3::setupFontCache ()//     from /usr/local/sgi-inventor/usr/lib/libInventor.so//  #2  0x40475845 in SoText3::computeBBox ()//     from /usr/local/sgi-inventor/usr/lib/libInventor.so//  #3  0x404676df in SoShape::getBoundingBox ()//     from /usr/local/sgi-inventor/usr/lib/libInventor.so//  #4  0x40413265 in SoNode::getBoundingBoxS ()//     from /usr/local/sgi-inventor/usr/lib/libInventor.so//  #5  0x4039cbaf in SoGetBoundingBoxAction::beginTraversal ()//     from /usr/local/sgi-inventor/usr/lib/libInventor.so//  #6  0x40399070 in SoAction::apply ()//     from /usr/local/sgi-inventor/usr/lib/libInventor.so//  #7  0x8049964 in timerSensorCallback (data=0x0) at coinhistory.cpp:818//  #8  0x4048d961 in SoSensor::trigger ()//     from /usr/local/sgi-inventor/usr/lib/libInventor.so//  #9  0x4048e8e2 in SoTimerSensor::trigger ()//     from /usr/local/sgi-inventor/usr/lib/libInventor.so//  #10 0x4048dee5 in SoSensorManager::processTimerQueue ()//     from /usr/local/sgi-inventor/usr/lib/libInventor.so//  #11 0x40078cf1 in SoXtEventHandler::xtTimerCallback ()//     from /usr/local/sgi-inventor/usr/lib/libInventorXt.so//  #12 0x4078a33a in _XtRemoveAllInputs () from /usr/X11R6/lib/libXt.so.6//  #13 0x4078a5a9 in XtAppNextEvent () from /usr/X11R6/lib/libXt.so.6//  #14 0x400789d0 in SoXt::mainLoop ()//// Looks like a bug in SGI Inventor that is hard to make a work-around// for.  20010919 mortene.#include <math.h>#include <stdlib.h> // exit()#include <time.h>#if HAVE_CONFIG_H#include <config.h>#endif // HAVE_CONFIG_H#include <Inventor/@Gui@/So@Gui@.h>#include <Inventor/@Gui@/viewers/So@Gui@ExaminerViewer.h>#include <Inventor/SbLinear.h>#include <Inventor/nodes/SoScale.h>#include <Inventor/nodes/SoBaseColor.h>#include <Inventor/nodes/SoCone.h>#include <Inventor/nodes/SoCube.h>#include <Inventor/nodes/SoCylinder.h>#include <Inventor/nodes/SoShapeHints.h>#include <Inventor/nodes/SoSphere.h>#include <Inventor/nodes/SoSeparator.h>#include <Inventor/nodes/SoText2.h>#include <Inventor/nodes/SoText3.h>#include <Inventor/nodes/SoDirectionalLight.h>#include <Inventor/nodes/SoPerspectiveCamera.h>#include <Inventor/nodes/SoTransform.h>#include <Inventor/nodes/SoRotation.h> #include <Inventor/nodes/SoFont.h>#include <Inventor/sensors/SoTimerSensor.h>#include <Inventor/fields/SoMFString.h>#include <Inventor/sensors/SoFieldSensor.h>#include <Inventor/errors/SoDebugError.h>#include <Inventor/nodes/SoMaterial.h>#include <Inventor/nodes/SoShape.h>#include <Inventor/nodes/SoTexture2.h>#include <Inventor/nodes/SoTextureCoordinateEnvironment.h>#include <Inventor/nodes/SoTranslation.h>#include <Inventor/nodes/SoOrthographicCamera.h>#include <Inventor/elements/SoCoordinateElement.h>#include <Inventor/elements/SoModelMatrixElement.h>#include <Inventor/actions/SoGLRenderAction.h>#include <Inventor/actions/SoGetBoundingBoxAction.h>// The History of Coinchar text2[] = "\The History of Coin                  \n\The humble beginning of Coin goes all the way back to late 1995 when the software developers \at Systems in Motion created a 3D graphics rendering library inspired by, and designed to \support, the VRML 1.0 file format. This library was used in amongst others SIM's VRMLview \and Rational Reducer. \n\\n\.....................................\n\                  \n\After years of extensions, optimizations, and what-have-you, SIM's \rendering library began to reach its limitations and needed a serious rework with a better \fundamental design. We needed flexibility, functionality and extensibility to be able to support \the requirements of future versions of Rational Reducer, as well as efficient development of \custom solutions for our partners. We needed a high-level, retained mode rendering library with \support for multiple platforms and multiple file formats. \n\\n\.....................................\n\                  \n\Parts of the API was already quite like \the Open Inventor API on the surface, and since the fundamental design of the Open Inventor API \is so excellent, we chose to make our new library, then named Coin, API compatible with Open \Inventor. \n\                  \n\The API decision was followed by a long period of \"inventorizing\" our rendering \library. \\n\.....................................\n\                  \n\With an alternative to SGI's and TGS' Open Inventor libraries on our hands, we thought; \Why not make this great tool available to the rest of the community? The launch of Coin under \the LGPL, and later under a commercial license, is the direct answer to that question. \n\\n\.....................................\n\                  \n\Our dream is to combine efficient coding \and efficient performance into a library \that will be a must for anyone writing \software for 3d graphics.        \n\\n\.....................................\n\                    \n";int textpos;int textlen;float deltax;int line;int spos;int currpart;SbTime lastlettertime; #define XPOS -9.5f#define LINE_BREAK 40#define NUM_PARTICLES 160#define NUM_LINES 3#define FALLDELAY 3.0f#define TEXTDELAY 0.04fstatic int envq_raw[] = {  857153075,857022515,672275240,588191011,588191011,537729056,520886303,  504174878,520886303,537663520,604838436,554571809,437063962,521016351,  655496999,756423469,689249065,622008613,689183017,672275240,588191523,  638720806,655432231,655431975,571348770,571414306,554637089,588257571,  722805035,588388643,554767905,571676450,571808290,723591467,874915380,  942220856,992684091,1076767808,1043016254,992356667,925115959,790504495,  723065899,622073893,554964257,537924384,537989920,537924640,537925152,  537924896,588191011,638588710,655366439,638523174,588060451,554637345,  453907483,470881820,487330333,504238622,437063706,537793312,638588454,  756161069,672273704,655431719,554636577,521015839,504238878,470553628,  487265053,487331101,487200029,537663008,554636833,588257315,537924896,  554768161,655563303,756489261,756423981,722672683,722803755,672209192,  588257059,621877797,588454435,621943077,588192291,554637089,521082655,  554702881,622009125,554833697,588584995,622205477,622337061,824517169,  908535350,975775546,1009526844,1110584898,1043082046,975645242,942156344,  857876531,689512489,588454435,537924640,521147167,521081887,537859360,  537924640,537924896,588257059,638588966,621746213,604903204,571545378,  470750236,403707160,403509528,722803499,924655927,521345311,436998426,  437063194,604836644,537727776,504238622,504172830,470618396,436998426,  403443992,453841435,453775899,487330589,554636577,537728288,504239134,  605231140,554702369,655562279,773200942,789978415,756423981,705961002,  621877285,554899489,571610658,554833953,571676962,571611682,538122272,  537991456,554768417,588388387,605297700,706485802,790568751,689905705,  858071603,959063097,992749371,1043343934,1177760326,1009396796,958803513,  1009399100,959001145,723199019,554768673,521148191,504239134,537859104,  537990688,487526941,537793824,588125731,588125987,604968740,537925408,  470815516,403837976,369758230,638587686,992224059,605559332,639245350,  487658525,420220697,470552348,470487324,470618396,470683932,453775387,  420155161,403247128,420287001,436998682,470618396,504238622,487330077,  521147167,437063706,537925152,638785574,773135662,756423981,722738219,  588388387,554834209,554833697,521213471,554833697,605362468,622205733,  571742242,571742754,538056480,571611426,655826215,706485546,790633519,  874650932,992683067,1009526844,1060317759,1144402756,1144403012,975581498,  1228162889,1278757964,1093615169,689775145,537991200,504173854,504239134,  521016351,487461405,504173342,520950815,571348514,588191011,537925152,  454038043,420548889,420417817,520753695,891298869,706156842,437260826,  605625380,521410079,420352025,420154905,453840923,470618140,470552860,  470618140,420155161,386600983,420221721,403444248,470618396,470618396,  487395613,487527197,436867354,554833185,621942565,672406056,655563047,  554767649,521148447,521213727,521081887,487592733,537924640,571676450,  655825191,655956263,588716323,555030561,638917414,739909420,925443639,  993011259,1228220745,1245261642,1110583874,1178416454,1077424448,1161182533,  1464357207,1716544102,1295337037,891629109,571677730,504239646,504239134,  487396125,470422044,487395869,487461149,537793056,554505249,521081887,  470749468,420548889,437063706,587928099,908076854,622074405,285477393,  470946844,521344543,487724317,454103835,403509784,470683932,470684188,  504369694,453775643,420090137,420221465,436998682,386535447,504304414,  487395869,487461405,487592989,521081375,487461405,554833441,588453923,  487659037,470684700,504370718,470684956,622205477,571742242,588519459,  605428260,571741730,672733736,655890983,622270757,689577257,773857582,  1228683337,1279209804,1245457994,1127755075,993406523,1212629320,1279806540,  1717331046,2104389245,1750420840,1043214142,706356010,554703393,487396893,  537925152,419958809,436801562,453644315,487461405,504173086,504173086,  420417561,437326106,436932378,688854569,1261056843,621613861,285478161,  370153750,454103835,420352281,470881308,487724573,470815772,555095585,  571742242,520950559,453447963,436800794,436932122,453840923,436932378,  386666775,538188064,504304414,605230628,521016351,470618652,537990688,  521147423,470751004,453907995,521148191,571677218,454039067,538254112,  420353049,555097121,538450976,706551850,655956519,740040236,757014829,  925312823,1632586593,2002672247,1751862888,1279868748,1397577299,1717925990,  -1987739511,1987078774,2070833019,1481130072,823797809,605101860,604970532,  470488092,520886559,403051032,403247384,420155929,420154905,487526941,  403443224,470880796,487395613,654971431,1445674070,504107038,537990176,  369560342,470618396,403311896,504567326,470947100,454038299,487526941,  537595936,520753695,503910942,453710107,487330333,554833441,487461405,  470618396,386667031,504436510,504304414,638916646,504173342,504239134,  504238878,504173342,420288025,487528477,571611426,622074405,504436510,  538122528,588651555,453907483,571874338,740106796,723196971,807412016,  841229874,1093677633,1750752104,1936092787,1884647024,2002874743,1969973621,  1566264157,-1853976431,-1551000157,2002872951,1177302342,907817014,621813541,  554507041,588389411,537664032,453580059,453776155,437064218,504369694,  420220697,437194522,487460893,587797027,1244148298,671618088,436932634,  504304158,436932378,420089113,369756950,470881308,470881308,470749724,  470683932,655037479,503976222,436932890,420220953,470683932,537924640,  453709851,436932634,420353049,487593501,521147423,638916646,504173342,  537859360,554702369,521016351,470619420,521082399,605231396,706091818,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -