Install Guide v Inv 252 exe v XFOIKEY

  • Slides: 16
Download presentation

Install Guide v Inv 252. exe를 실행 v XF-OIKEY. COM을 커멘트라인으로 실행시켜 버전을 2.

Install Guide v Inv 252. exe를 실행 v XF-OIKEY. COM을 커멘트라인으로 실행시켜 버전을 2. 5 용 key , expire날짜 , host id 얻어낸다. v 시작메뉴의 TGS open inventor 항목에서 license Admin 실행 v Version을 2. 5로 하고 key , expire날짜 , host id 를 넣고 apply 한다 v 이전버젼과의 호환을 위해 dll들을 system폴더에 복사 한다. v 리부팅한다. 2 2/20/2021 Sunghwan Min

Build IVF Viewer v Visual studio 를 실행 v New 를 클릭하면 project 탭

Build IVF Viewer v Visual studio 를 실행 v New 를 클릭하면 project 탭 하위에 IVF app. Wizard를 선택 v Step 5에서 생성될 Viewer옵션을 선택한다. v 컴파일후 실행 3 2/20/2021 Sunghwan Min

“Hello , Cone” v This chapter begins with a set of sample programs that

“Hello , Cone” v This chapter begins with a set of sample programs that illustrate the key aspects of Inventor v Example 2 -1 Ø Creates a red cone and then renders it in a window Ø Use Inventor Xt window Ø Construct a simple scene graph composed of camera node , a light node , a material node , and a cone node v The purpose of this chapter Ø Simply to convey a feel for the tools Inventor 4 2/20/2021 Sunghwan Min

A Red Cone v Basic steps Ø 1. Create a window where the scene

A Red Cone v Basic steps Ø 1. Create a window where the scene will be rendered Ø 2. Build the scene graph by creating property and shape node and combining them into groups 5 2/20/2021 Sunghwan Min

A Red Cone (cont. ) #include <Inventor/Xt/So. Xt. h> #include <Inventor/Xt/So. Xt. Render. Area.

A Red Cone (cont. ) #include <Inventor/Xt/So. Xt. h> #include <Inventor/Xt/So. Xt. Render. Area. h> #include <Inventor/nodes/So. Cone. h> #include <Inventor/nodes/So. Directional. Light. h> #include <Inventor/nodes/So. Material. h> #include <Inventor/nodes/So. Perspective. Camera. h> #include <Inventor/nodes/So. Separator. h> #ifdef WIN 32 #define main iv. Main #endif Void main(int , char **argv) { // Initialize Inventor. This returns a main window to use. // If unsuccessful, exit. Widget my. Window = So. Xt: : init(argv[0]); // pass the app name if (my. Window == NULL) exit(1); // Make a scene containing a red cone So. Separator *root = new So. Separator; So. Perspective. Camera *my. Camera = new So. Perspective. Camera; So. Material *my. Material = new So. Material; root->ref(); root->add. Child(my. Camera); root->add. Child(new So. Directional. Light); 2/20/2021 Sunghwan Min 6

A Red Cone (cont. ) my. Material->diffuse. Color. set. Value(1. 0, 0. 0); //

A Red Cone (cont. ) my. Material->diffuse. Color. set. Value(1. 0, 0. 0); // Red root->add. Child(my. Material); root->add. Child(new So. Cone); // Create a render. Area in which to see our scene graph. // The render area will appear within the main window. So. Xt. Render. Area *my. Render. Area = new So. Xt. Render. Area(my. Window); // Make my. Camera see everything. my. Camera->view. All(root, my. Render. Area->get. Viewport. Region()); // Put our scene in my. Render. Area, change the title my. Render. Area->set. Scene. Graph(root); my. Render. Area->set. Title("Hello Cone"); my. Render. Area->show(); So. Xt: : show(my. Window); // Display main window So. Xt: : main. Loop(); // Main Inventor event loop } 7 2/20/2021 Sunghwan Min

To Make the Cone Spin v How to use engines to make the cone

To Make the Cone Spin v How to use engines to make the cone spin Ø The engine changes the angle value in the rotation. XYZ node in response to changes in the real-time clock Ø Example 2 -2 8 2/20/2021 Sunghwan Min

“Hello, Cone” Using Engines v 추가된 코드 // This transformation is modified to rotate

“Hello, Cone” Using Engines v 추가된 코드 // This transformation is modified to rotate the cone So. Rotation. XYZ *my. Rot. XYZ = new So. Rotation. XYZ; root->add. Child(my. Rot. XYZ); // An engine rotates the object. The output of my. Counter // is the time in seconds since the program started. // Connect this output to the angle field of my. Rot. XYZ->axis = So. Rotation. XYZ: : X; // rotate about X axis So. Elapsed. Time *my. Counter = new So. Elapsed. Time; my. Rot. XYZ->angle. connect. From(&my. Counter->time. Out); 9 2/20/2021 Sunghwan Min

Adding a Trackball Manipulator v The next two examples show additional methods for editing

Adding a Trackball Manipulator v The next two examples show additional methods for editing a node in the scene graph v Add manipulator to the first example Ø When left mouse button is pressed on the trackball , it highlights itself in a different color to show it is active Ø While it is active , the mouse can be used to rotate the trackball and the object v In this example , a trackball is constructed instead of the So. Rotation. XYZ node v Render area has a sensor attached to the scene graph , the scene is automatically rendered again after each edit 10 2/20/2021 Sunghwan Min

Adding a Trackball Manipulator (cont. ) Void main(int , char **argv) { // Initialize

Adding a Trackball Manipulator (cont. ) Void main(int , char **argv) { // Initialize Inventor and Xt Widget my. Window = So. Xt: : init(argv[0]); if (my. Window == NULL) exit(1); So. Separator *root = new So. Separator; root->ref(); So. Perspective. Camera *my. Camera = new So. Perspective. Camera; root->add. Child(my. Camera); // child 0 root->add. Child(new So. Directional. Light); // child 1 root->add. Child(new So. Trackball. Manip); // child 2 So. Material *my. Material = new So. Material; my. Material->diffuse. Color. set. Value(1. 0, 0. 0); root->add. Child(my. Material); root->add. Child(new So. Cone); So. Xt. Render. Area *my. Render. Area = new So. Xt. Render. Area(my. Window); my. Camera->view. All(root, my. Render. Area->get. Viewport. Region()); my. Render. Area->set. Scene. Graph(root); my. Render. Area->set. Title("Trackball"); my. Render. Area->show(); So. Xt: : show(my. Window); So. Xt: : main. Loop(); } 2/20/2021 Sunghwan Min 11

Examiner Viewer v It provides a user interface that allow use of the mouse

Examiner Viewer v It provides a user interface that allow use of the mouse to modify camera placement in the scene v Does not need to set up a camera and call view. All() because the viewer does this automatically 12 2/20/2021 Sunghwan Min

A Red Cone (cont. ) Void main(int , char **argv) { Widget my. Window

A Red Cone (cont. ) Void main(int , char **argv) { Widget my. Window = So. Xt: : init(argv[0]); if (my. Window == NULL) exit(1); So. Separator *root = new So. Separator; root->ref(); So. Material *my. Material = new So. Material; my. Material->diffuse. Color. set. Value(1. 0, 0. 0); root->add. Child(my. Material); root->add. Child(new So. Cone); // Set up viewer: So. Xt. Examiner. Viewer *my. Viewer = new So. Xt. Examiner. Viewer(my. Window); my. Viewer->set. Scene. Graph(root); my. Viewer->set. Title("Examiner Viewer"); my. Viewer->show(); So. Xt: : show(my. Window); So. Xt: : main. Loop(); } 2/20/2021 Sunghwan Min 13

Naming Conventions v Sb Ø Basic types (for scene basic) Ø Sb. Color ,

Naming Conventions v Sb Ø Basic types (for scene basic) Ø Sb. Color , Sb. View. Volume v So Ø All other classes in Inventor ( for scene object) Ø So. Cone, So. Perspective. Camera , So. Material , So. Transform v Methods and variables begin with a owercase letter Ø get. Normal() , set. Scene. Graph() v Enumerated type values Ø FILLED , PER_PART 14 2/20/2021 Sunghwan Min

Scene Basic Types Sb. Boolean value Sb. Boxnx 2 D or 3 D box

Scene Basic Types Sb. Boolean value Sb. Boxnx 2 D or 3 D box Sb. Color RGB color value Sb. Cylinder cylinder Sb. Line directed 3 D line Sb. Matrix 4 x 4 matrix Sb. Name character string Sb. PList list of generic pointer Sb. Plane oriented 3 D plane Sb. Rotation representation of a 3 D rotation about an arbitrary axis Sb. Sphere sphere Sb. String “smart” character strings that have many convenience method Sb. Time representation of time Sb Vecnx 2 D or 3 D vector Sb. Viewport. Region active viewport region within a display window Sb. View. Volume view volume 15 2/20/2021 Sunghwan Min

Method v Each Sb class has useful operators associated with it Sb. Vec 3

Method v Each Sb class has useful operators associated with it Sb. Vec 3 f v(1. 0, 2. 0, 3. 0); V. normalize() v Fields Ø Store parameters for nodes Ø A field contains a value of a certain type v Coordinate Systems Ø Right-hand Ø Angles are specified in radians 16 2/20/2021 Sunghwan Min