Vega  FAQ's FAQs 51 thru 100

 

FAQs 1 thru 51 square72_blue.gif FAQs 51 thru 100 square72_blue.gif FAQs 101 thru 150 square72_blue.gif FAQs 151 thru 200 square72_blue.gif FAQs 201 thru 250 square72_blue.gif FAQs 251 thru 300

     

  1. What 3d model file formats does Vega Support:

  2. How to I use 3ds, Dxf, 3d Max files in Vega

  3. Can I use Borland C++ Builder with Vega NT

  4. Can I use Vega in MFC

  5. How do I get debug information with MFC and Vega NT

  6. Can I use Vega in a container such as ActiveX

  7. Is there a COM interface for VegaNT

  8. Can I use Vega with Tcl/TK

  9. What is vgTcl

  10. How do I get a Vega class property

  11. How do I change a Vega class property

  12. How do I set a property on vgSystem before

  13. How to find a vgObject

  14. How do I delete an vgObject

  15. How can I find out if a vgObject is in my FOV

  16. How do I create a vgObject in Code

  17. How to get a position of an vgObject

  18. Why does my vgObjects Position always return 0,0,0

  19. How to position a vgObject

  20. How to find a vgPart

  21. How do I delete a vgPart

  22. How to get a position of a vgPart

  23. Why can't I position my vgPart

  24. How do I compile my Vega Irix applications statically

  25. What is Distributed Vega

  1. How can I restart Vega

  2. How do I move things in Vega

  3. What motion models does Vega provide

  4. What is the Spin Motion Model

  5. What is the Drive Motion Model

  6. What is the UFO Motion Model

  7. What is the Warp Motion Model

  8. What is the Fly Motion Model

  9. What is the Trackball Motion Model

  10. What is the Missile Motion Model

  11. What is a Walk Motion Model

  12. What is a PickFly Motion Model

  13. What is the Flight Simulation Motion Model

  14. What is a Device Direct Motion Model

  15. What is a Symmetric Viewing Frustum  

  16. What is a Asymmetric Viewing Frustum  

  17. What is a Orthographic  Viewing Frustum

  18. How can I Show the frame rate of my application

  19. Can I disable the ~ key

  20. How can I get Statistics in Code

  21. What is a bitplane

  22. What are the core Vega Classes

  23. What is the difference between vgGetPos and vgGetWCSPos

  24. What Graphics state Properties are supported

  25. What is an LOD

Faq's

 

 

* 51 *   What 3d model file formats does Vega Support  up

     

    Vega for NT directly supports the following 3D file format

     

    flt

     

    fst

    MultiGen's OpenFlight v14 and above

     

    MultiGen's fast binary file format

     

    Vega for Irix supports the following 3D file format ( the same as OpenGL Performer 2.2.x)

     

    flt

    pfa

    pfb

    dxf

    3ds

    obj

    dwb

    lsa

    lsb

    bin

    bpoly

    byu

    gds

    gfo

    im

    irtp

    iv

    m

    medit

    nff

    post

    phd

    poly

    pts

    ptu

    s1k

    sgf

    sgo

    spf

    sponge

    star

    stla

    stlb

    sv

    tri

    unc

    MultiGen OpenFlight v14 and above

    OpenGL Performer ASCII format

    OpenGL Performer fast binary format

    AutoDesk AutoCAD ASCII format

    AutoDesk 3DStudio binary data ( OLD!!!!!)

    Wavefront Technologies data format

    Coryphaeus Software Designer's Workbench

    Lightscape radiosity solutions (ASCII)

    Lightscape radiosity solutions (binary)

    Minor SGI format used by powerflip

    Side Effects Software PRISMS binary

    Brigham Young University CAD/FEA data

    McDonnell-Douglas GDS things data

    Minor SGI format (radiosity output)

    Minor SGI format (OpenGL Performer example)

    AAI/Graphicon Interactive Real-Time PHIGS

    SGI Open Inventor/VRML 1.0

    University of Washington mesh data

    Medit Productions medit modeling tool

    Eric Haines' ray tracing test data format

    Minor SGI format (example gridded terrain loader)

    Minor SGI format (polyhedra)

    Side Effects Software PRISMS ASCII data

    University of Washington point data

    Minor SGI format (OpenGL Performer example)

    U.S. Army SIMNET databases (Texas Instruments)

    U.S. Navy standard graphics format

    Minor SGI format

    U.S. Navy simple polygon format

    Sierpinski sponge 3D fractal generator

    Yale University compact star chart data

    3D Structures Stereolithography (ASCII)

    3D Structures Stereolithography (binary)

    Format of John Kichury's i3dm modeler

    University of Minnesota Geometry Center data

    University of North Carolina data

     

     

* 52 *    How to I use 3ds, Dxf, 3d Max files in Vegaup

     

* 53 *   Can I use Borland C++ Builder with Vega NT up

     


    Vega NT is only supported on Microsoft Visual Studio ( Service pack 5 and above)

    A couple of people have had some success in using Borland's C++ Builder, here's the details of what they have done, I cannot say if this will work or not

    1) Convert all lib files to Borland compatible.


      This bat file (mycoff2omf.bat) will convert a lib file to Borland format, using the coff2omf routine supplied with C++:

      @echo off

      Coff2omf -q %1 x.lib >> convertlog.txt

      if errorlevel 1 goto :fail

      copy %1 orig_lib

      copy x.lib %1

      echo File %1 copied and converted >> convertlog.txt

      goto :EOF

      :fail

      echo Error in file %1, not converted >> convertlog.txt

      The Coff2omf routine is found in the Borland executable directory, and should be in the path.

      This bat file (convertAll.bat) uses the first bat file to convert all lib files in the Vega lib directory. The easiest way to do this is to put both bat files in the Vega directory.

      cd "c:\program files\paradigm\Vega\lib"

      mkdir orig_lib

      attrib -r *.lib 

      for %%f in (*.lib) do MyCoff2omf %%f

      del x.lib
       

    2) You have to modify the jlu.h file to eliminate a define of ptrdiff_t already defined by Borland: 


      #ifndef _BORLAND

      typedef int ptrdiff_t;

      #endif
       

    3) In you Borland project, under Project | Options | Directories/Conditionals in the Conditionals Edit box, enter:

      _DLL;_BORLAND;WIN32

     

* 54 *   Can I use Vega in MFCup

     


    Yes you can use Microsoft's Foundation Class library with Vega NT :

    Vega ships with a simple example project, see <%>Sample\Vega\pguide\ch03\MFCVega
     

* 55 *  How do I get debug information with MFC and Vega NT up

     


    Yes you can get the debug out in an MFC application that is normally sent to the console window in Vega NT

    This can be done in a couple of ways :
     

    • You can send the output to the debugger window of Visual Studio

      In your Vega directories search for "EditPlatform.bat" and run the batch file

      Then check the USE_OUTPUTDEBUGSTRING box and this will allow out put to the Visual Studio debug window.

       

    • You can  use vgCreateConsole();
    • Or you could  create your own console using AllocConsole();

       

       

      Code :

      --

         


        if( AllocConsole() ){

          

           //

           // Now we have to pipe the all Vega output to the new console window                

           //

          

           int outHandle = _open_osfhandle( ( long );

           

           GetStdHandle( STD_OUTPUT_HANDLE ), _O_TEXT  );

         

           FILE *outFile = _fdopen( outHandle, "w"  );

         

           *stdout = *outFile;

         

           setvbuf( stdout, NULL, _IONBF, 0 );

         

           }

         

         

       

     

* 56 *   Can I use Vega in a container such as ActiveX  up

     


    Yes and no is the answer to using Vega NT in an ActiveX container. While it is certainly possible to use Vega in an ActiveX container is has one inherent and very limiting factor. Vega NT gets its heritage from Vega Irix and OpenGL Performer, which are designed to be use as stand alone application both call exit(0) during there shutdown process.

    Vega and Performer both use large amounts of memory and create their own memory pool and manager. This memory pool other major components of Vega and Performer are only correctly freed when the program Exits. This means that they are not re-entrant  meaning you cannot simply  initialise start stop and repeat the initialise, start, stop Vega or Performer again by default they both call Exit(0) during their shutdown process.
     

* 57 *   Is there a COM interface for VegaNT up

     

    No there is no COM interface for VegaNT, ( Vega Irix does have a TCL/TK interface )

     

* 58 *   Can I use Vega with Tcl/TK  up

     

    Yes you can use Tcl/TK with Vega, vgTcl provides Tcl//TK bindings for Vega and  was created by the talented Mike Weiblen.

    vgTcl was distributed with Vega on the installation CD's as a vgGift, which means it was officially unsupported by MultiGen-Paradigm although it was maintained by Mike Weiblen.

     

* 59 *   What is vgTcl up

     

    vgTcl provides Tcl//TK bindings to Vega, vgTcl was distributed with Vega on the installation CD's as a vgGift,

    Further details on vgTcl can be found on Mike Weiblen's web site vgTcl readme
     

* 60 *   How do I get a Vega class property up

     

     

    With Vega there are 2 ways to get properties from Vega Class instances

     

    • Firstly using the vgCommon  function   "float  vgGetProp( vgCommon *handle, int which )";

      For example to retrieve the state of a vgChannel we call int state = (int) vgGetProp( vgGetChan(0), VGCOMMON_ENABLED );

      See the individual vgClasses man pages for which properties can be retrieved using vgGetProp

    • Secondly using the class specific functions where the property cannot be returned as a float

      For example to retrieve the current filed of view form a channel we call

     

    Code :

    --

       

      float h = 0.0f;

      float v = 0.0f;

      vgGetChanFOV( vgGetChan(0), &h, &v  );


     

       

      See the individual vgClasses man pages for what vgGetxxx functions are available
       

* 61 *   How do I change a Vega class property up

     


    With Vega there are 2 possible ways to change properties for Vega Class instances.

     

    • Firstly using the vgCommon function   "void  vgProp( vgCommon *handle, int which, float prop )";

      For example to change the state of a vgChannel we call  vgProp( vgGetChan(0), VGCOMMON_ENABLED, VG_ON );

      See the vgClasses individual man pages for which properties can be changed using vgProp

    • Secondly using the class specific functions where the property cannot be set with float or int

      For example to  the current filed of view for  a channel we call

       

    Code :

    --

       

      float h = 45.0f;

      float v = -1.0f;

      vgChanFOV( vgGetChan(0), h, v  );


     

      See the individual vgClasses man pages for what vgClassxxx set functions are available
       

* 62 *  How do I set a property on vgSystem beforeup

     


    Generally to set properties on Vega Classes using vgProp(..)  Vega must first have been initialised using vgInitStys(). So how can you set System properties if vgInitStys() has not been called, well its rather straight forward use vgClassProp for example:

     

     

    Code :

    --

       

       

      vgClassProp( VGTYPE_SYSTEM, VGSYS_GRAPHICS, VG_FALSE );

       

       

      vgInitSys();

       

       

      vgDefineSys( argv[1] );

       

       

      vgConfigSys();

       


     

     

    See vgCommon for more details; vgClassProp and vgGetClassProp are very similar to their related functions (vgProp and vgGetProp), but they set and return class properties. Class properties are those which exist at the class level. In other words there is one for each class, as opposed to one for each class instance.
     

* 63 *  How to find a vgObject up

     


    To find a vgObject is pretty straight forward, there are two ways to get a pointer to a specific vgObject

     

    • Firstly you can find an vgObject by name using vgFindObj( "objectName");,Note the text search is case sensitive, also if you have vgObject with same name the first one in Vega internal list will be returned
    • Secondly you can get a vgObject by using vgGetObj( int index)  if you know the index. Note that if you delete a vgObject then indices of other object may change.

    See vgObject man pages further details on the vgObject Class

* 64 *  How do I delete an vgObject up

     


    To delete a vgObject simply use the vgCommon function vgDelete( vgCommon *handle ); For example :

    Code :

    --

       

      vgObject *obj = vgGetObj( 0 );

      vgDelete( obj );


     

     

    Note before you attempt to use vgDelete() you must first ensure that the vgObject is removed from all association with vgScene, vgPlayer, etc.

    See vgObject man pages further details on the vgObject Class

* 65 *   How can I check if a vgObject is within my FOV up

     


    The following pseudo code show you how to test is a vgObject is within the current Field of View:

     

    • get the pfNode* from the vgObject with vgGetPfNode (see the vgObject man page)
    • get the bounding sphere from the pfNode (see the pfNode man page)
    • get the pfChannel from the vgChannel, vgGetChanPfNode (see the vgChannel man    )
    • call pfChanContainsSphere( chanPointer, spherePointer)  (see the pfChannel man    )


    See the  "How Check if a vgObject is in the FOV" Sample code for further details

    See vgObject man pages further details on the vgObject Class

* 66 *  How do I create a vgObject in code up

     


    To create a new vgObject in code you have to do the following:
     

    • Create a new and empty vgDataSet with vgNewDS
    • Set the path to the file for the dataset to load with vgName
    • Use vgProp to set initial properties on the dataset
    • Load the model file using vgLoadDS
    • Create a new empty vgObject
    • Name the vgObject
    • Set the vgObject as dynamic or static with vgProp
    • Set the optimisation mode for the object with vgProp
    • Set any offset for the object with vpPos
    • Associate the vgObject and vgDataSet using vgObjDS
    • Now we make the object with vgMakeObj
    • Set the Isector mask for the vgObject and its geometry
    • Set the representation mask for the vgObject

     

    See the  "How to create a vgObject" Sample code for further details

    See vgObject man pages further details on the vgObject Class

    See vgPart man pages further details on the vgPart Class

    See vgDataSet man pages further details on the vgDataSet Class

    See vgMotion  man pages further details on the vgMotion Class

    See vgCPos man pages further details on the vgCPos Class


* 67 *   How do you get the Position of a vgObject up

     


    To get the position of a vgObject you need to use a vgPos, something alone the lines of:

    Code :

    --

       

      vgObject   *obj = NULL;

      vgPosition *pos = NULL;

       

      float x = 0.0f, y = 0.0f, z = 0.0f;

      float h = 0.0f, p = 0.0f, r = 0.0f;

       

      //

      //  Grab a pointer to the object

      //     

      obj  = vgGetObj( 0 );

       

      //

      //  Create a vgPos

      //     

      pos  = vgNewPos( );

       

      //

      //  Retrieve the current position from the object

      //     

      vgGetPos( obj, pos );

       

      //

      //  Now retrieve the position vectors

      //     

      vgGetPosVec( pos, &x, &y, &z, &h, &p, &r );

       

      //

      //  Release the vgPos as where done

      //     

      vgDelPos( pos );

       

     

    See the  "How get the vgObject Position" Sample code for further details

    See vgObject man pages further details on the vgObject Class

    See vgCPos man pages further details on the vgCPos Class

* 68 *   Why does my vgObjects position always 0,0,0 up

     


    First make sure that your vgObject has actually been added to your vgScene

    If the vgObject has been attached to a vgPlayer or your using Vega LADBM then using vgGetPos will return 0,0,0 for your position because this will return the only the local position

    To get the position of the vgObject in this instance you need to get the World coordinates rather than the local coordinates thus we need to use vgGetWCSPos rather than the vgGetPos function

    See the  "How get the vgObject World Coordinate Position" Sample code for further details

    See vgObject man pages further details on the vgObject Class

    See vgCPos man pages further details on the vgCPos Class

* 69 *    How can I set the position of a vgObject up

     


    Setting the postion of an Object in Vega is unfortunately a little awkward than it needs to be, in that you must first get the objects current position if you   want to update only part of the object translation or rotation. For example:

    Code :

    --

       

      vgObject   *obj = NULL;

       

      vgPosition *pos = NULL;

       

      float x = 0.0f, y = 0.0f, z = 0.0f;

      float h = 0.0f, p = 0.0f, r = 0.0f;

       

      //

      //  Grab a pointer to the object

      //     

      obj  = vgGetObj( 0 );

       

      //

      //  Create a vgPos

      //     

      pos  = vgNewPos( );

       

      //

      //  Retrieve the current position from the object

      //     

      vgGetPos( obj, pos );

       

      //

      //  Now retrieve the position vectors

      //     

      vgGetPosVec( pos, &x, &y, &z, &h, &p, &r );

       

      //

      //  Now update the vectors

      //     

      x = x + 10.0f;

      y = y + 20.0f;

      z = z + 30.0f;

       

      //

      //  Now We can Set the position vectors

      //     

      vgPosVec( pos, x, y, z, h, p, r );

       

       

      //

      //  Now we can finally set the current position for the object

      //     

      vgPos( obj, pos );

       

       

      //

      //  Release the vgPos as where done

      //     

      vgDelPos( pos );

       

       

     

    See its a little awkward ;), also not if your doing this alot it would be make sense to create a function and also keep the vgPosition instance around rather than creating and deleting each time ( its faster and stops fragmentation )

    See vgObject man pages further details on the vgObject Class

    See vgCPos man pages further details on the vgCPos Class

* 70 *  How can I find a vgPart in vgObject up

     


    There are two ways to find and retrieve vgParts from a vgObject using the 2 following functions:

     

    • vgFindPart
       
    • vgFindPartOccurence


    vgFindPart finds a named vgPart of an vgObject. If the name is NULL, then the root vgPart of the vgObject is returned. If multiple vgParts within the vgObject have the same name, the first occurrence of that vgPart will be returned if the third argument is set to NULL. To find subsequent occurrences, the third argument should be a pointer to the previous vgPart found.

    Code :

    --

       

      vgObject *obj = NULL;

      vgPart   *w1  = NULL;  

      vgPart   *w2  = NULL;

      vgPart   *w3  = NULL;

      vgPart   *w4  = NULL;

       

       

      //

      //  Grab a pointer to the object

      //     

      obj = vgFindObj( "Blue Car" );

      w1 = vgFindPart ( obj, "wheel", NULL );

      w2 = vgFindPart ( obj, "wheel", w1 );

      w3 = vgFindPart ( obj, "wheel", w2 );

      w4 = vgFindPart ( obj, "wheel", w3 );

       

       

     

     

    vgFindPartOccurence will also find a named vgPart of an vgObject. If multiple vgParts within the vgObject have the same name, the 'n-th' occurrence of the vgPart can be directly retrieved by setting the third argument to 'n'.

    Code :

    --

       

      vgObject *obj = NULL;

      vgPart   *w1  = NULL;  

      vgPart   *w2  = NULL;

      vgPart   *w3  = NULL;

      vgPart   *w4  = NULL;

       

       

      //

      //  Grab a pointer to the object

      //     

      obj = vgFindObj( "Blue Car" );

      w1 = vgFindPartOccurence ( obj, "wheel",);

      w2 = vgFindPartOccurence ( obj, "wheel", 2 );

      w3 = vgFindPartOccurence ( obj, "wheel", 3 );

      w4 = vgFindPartOccurence ( obj, "wheel", 4 );

       

       

     

    See vgObject man pages further details on the vgObject Class

    See vgPart man pages further details on the vgPart class

     

* 71 *  How to Delete a vgPartup

     


    Its pretty straight forward to delete a vgPart you simply use vgDelete

    Code :

    --

       

      vgObject *obj  = NULL;

       

      vgPart   *part = NULL;  

       

       

      //

      //  Grab a pointer to the object

      //     

      obj  = vgFindObj( "my_nice_object" );

      part = vgFindPart ( obj, "wheel",