Vega prime  FAQs 101 thru 150

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

  1. Why do My Models Load Slowly in Vega Prime 2.0
  2. Where did the Compatibility Mode go in Lynx Prime 2.0
  3. Should I Compress My Textures
  4. Should I Inline textures in my VSB Files
  5. Should I Regenerate Normals when Loading Files
  6. Does Vega Prime Support VRML Format
  7. What Model Formats does Vega Prime Support
  8. How Can I Convert my Models to Vega Prime Format
  9. I get Errors when Closing Vega Prime Application
  10. Why Does my Bump Isector Not Work
  11. Why is the Font Size Very Small in Vega Prime 2.0
  12. Does Vega Prime Support the equivalent to  VGOBJ_CLONE
  13. How can I Do an Intersection with a Particle Effect
  14. How Can I find a Particular Face from my OpenFlight File
  15. Can I use  Line Breaks with vsStrings
  16. How Can I get the Application Window Handle
  17. How Can I use Windows Send/Post Messages with Vega Prime
  18. Where are Opengl State Calls Made in Vega Prime
  19. How Can I Make a vpObject Transparent
  20. I'm Using VP Distributed but my Slave Objects are not Updating
  21. Uhh I Get a Warning convColor : Color Hue <***> is out of range
  22. Can I Load 3ds Max or Maya format files in Vega Prime
  23. Can I Create my Own Motion Model
  24. What Happened to vsSequence Class
  25. How to Set the Loop Duration of Animation in Vega Prime
  1. Does Vega Prime Support P-Buffers
  2. Does Vega Prime Support 3d Textures
  3. Does Vega Prime Support Stereo Rendering
  4. What Happened to the FindNamed Function
  5. How to check if a vpObject is within a vpChannel's FOV
  6. Changing the Channel Position Leaves Artifacts
  7. Can I use the Stencil Plane in Vega Prime
  8. How can I Keep the Vega Prime Window on Top
  9. How Can I Move the Vega Prime Window to the Top
  10. Why is the SkyDome All Screwy when I have a High Altitude
  11. How Can I Group vpObjects Together
  12. How Can I Pick Something in Vega Prime
  13. Where is the Equivalent to vgPicker  in Vega Prime
  14. Should I Use Multiple Windows or Multiple Channels
  15. Can I Limit process Shown by the 'drUtil' Tool
  16. How to Load Files from Another Thread
  17. Does Vega Prime Provide any Shadowing Capabilities
  18. Can I change the Cursor Shape in a Vega Prime Window
  19. How to get the vpPipeline of a vpWindow
  20. Can I Change an Embedded Vega Prime Windows Parent
  21. Can I have Splash Screen like Vega Classic
  22. How do I Compile Vega Prime Statically
  23. How can I Transform my Mouse Position to World Coordinates
  24. How do I Calculate the Horizontal Field of View
  25. How do I Calculate the Vertical Field of View.




* 101  Why do my Models Load So Slowly in Vega Prime 2.0 *  top

    Some users have seen some major issues with loading files models that loaded fine in Vega Prime 1.2x but take for every to load or do not load at into Vega Prime 2.0, this seems to affect OpenFlight and VSB files alike

    The way files are loaded was changed extensively for Vega Prime 2.0, with many  more option and optimization possibilities added ( these are actually very good changes, but the changes seem to have broken Lynx prime quite badly).

    It appear that if you try to load models listed in a Vega Prime 1.2 ACF file then you more likely to see the slow or no load problems.

    The solution for some is to create a new ACF from scratch using the Vega Prime 2.0 Lynx Prime.

    Alternatively load your models through code, you might want to check the code you use by saving a default ACF to a CPP file and check the vpObject settings

    This is a frustrating and needless Bug and should have been highlighted in the release notes etc ...


* 102  Where did the Compatibility Mode go in Vega Prime 2.0 *  top


    Where did the Compatibility Mode go that was in Vega Prime 1.x and Lynx Prime 1.x  I cannot find it in Lynx Prime 2.0

    The compatibility mode have been retired, and yes this is a good thing.

    The compatibility mode was an attempt to help uses transition to Vega Prime from performer and Vega Classic were the OpenFlight loader and Vega applied default materials and colours to objects. Thus allowed users to user there models in Vega Prime with out having to correct material and colour issues.

    Sadly compatibility mode just confused many people and was maybe was a little ill conceived or implemented and really should never have seen the light of day

    And now its gone but on the upside Vega Prime and Lynx Prime 2.0 have introduce lots of new features and many are on an Advance Tab,  there's lots of new properties to tweak and try out on the vpObject's Panel

    Don't be sad it really is a good thing that is has gone....


* 103  Should I Compress My Textures  *  top


    A common question these days is should I be compressing or  not compressing my texture ?

    One thing it depends on your platform  that your  models and textures are going to be used on.

    For instance, compressing on a PC based graphics system (Windows or Linux) is in most case the best way to go because  textures that have been compressed are much smaller and faster to use.  unfortunately you cannot compress textures on SGI hardware as SGI does not at present have support for compressed textures

    So on a system that  supports compression the yes use it.

    Note some graphic system while supporting the use of compressed textures do no off the ability to compress a texture.

    You can use the to_vsb and to_dds tools supplied with Vega prime 2.0 to convert and compress your textures


* 104  Should I Inline textures in my VSB Files *  top


    That decision to inline textures really depends on your content and how your content management philosophy.

    If you decide to inline your textures in your VSB files, then, on the pro side, you do not have to worry about individual texture files, paths, attributes etc anymore.

    There's a but, however, the VSB file size will bloat considerably .  And is you choose not  inline, then you open up a door for texture reuse across models. while in-lining will not share resources so you may get duplication, but can help for demos and protecting IP of textures etc.

    Note Vega Prime currently on supports in-lining in VSB files.

    You can create your in-lined VSB thru code or to_vsb


* 105  Should I Regenerate Normals when Loading Files *  top


    This depends on your models you are using.

    The "Regenerate normals" loader option will trashes any  old normals and generates new ones and generate normals where missing.

    The option has "normal tolerance" variable that is basically a dot-product that is used to set the maximum "crease angle" between two faces that can potentially share a normal at a mutual vertex. This basically controls how "sharp" the edges should be, and thus you can change this variable to get better visual results.

    Typically though you will normally (no pun intended), create you normals and set your shading using fine control in your modeling package such as in MultiGen-Creator. So you really would not normally have to use this option, as it will increase the load time and you don't have fine control as you would in your modeling package

    But if you have models that have no normals or are bad and or you cannot edit the models then you use this option to give you some acceptable if not perfect normals


* 106  *  Does Vega Prime Support VRML filestop

    Currently Vega Prime does not support the reading or loading of VRML or Inventor files.

    At this time I do not believe there are any plans to support the format in the near future.

    Stock answer from certain people will be that you can simply write your own loader, while true this is not practical course of action for most users.

    The so the only other practical option would be to use a format converter such as Polytrans or Deep Exploration.


* 107  * What Model Formats does Vega Prime Support top

    Unfortunately Vega Prime only supports 2 model formats directly:

    *.flt OpenFlight ( MultiGen-Creator format files )

    *.vsb Vega Scenegraph Binary ( Vega Primes proprietary binary format )

    Any other formats need to be converted to the OpenFlight using a format converter such as Polytrans or Deep Exploration.


* 108  *  How Can I Convert my Models to Vega Prime Formattop

    This would depend on what format your source models are in.

    Typically you should  be able to use a format conversion program such as Polytrans or Deep Exploration. These offer a good selection of import formats and the ability to output OpenFlight models.

* 109  *  I Get Errors When Closing my Vega Prime Application top


    If you get errors when closing your Vega Prime application such as or similar:

    "vrwindow::destroy GL Context:current thread is NOT a DRAW thread"

    This is normally an indication you did not shutdown Vega correctly before you application finished and exited

    Typically you must first shut Vega prime down before your application exits and you must call certain functions in the correct order .eg.


Code :




    vpKernel::instance()-> unconfigure();



    The functions must be called in the above order and from the APP thread, you cannot safely call these from any other thread such as a GUI thread etc.


* 110  * Why does my Bump Isector Not Work top


    One thing to check is that the line segments of the isector are long enough, by default Bump isector line segments are only 1 DBU in length.

    Also you need to ensure you have created an Isector Service manager and associated the bump isector with the service manager. Note that you only need one service manager which you share between all isectors.


* 111  *  Why is the Font Size is Very Small in Lynx Prime 2.0top


    Some users including my self have found the Font Size in Lynx Prime 2.0 to be very small about 7 or points in size making things hard to read for some, but Lynx Prime 1.x is OK

    It appears that a change was to the way the font size is set in Lynx Prime 2.0, the new default size does not seem to have been tested too much.

    There is a work around to this, but you have to edit one of the Lynx Prime configuration files : Open the file


    Search for a String which should read something along the lines of  "MS Shell Dlg,5.7....." or so. 

    The value should be around  : "MS Shell Dlg,8.3....."

    Note that the next time you re-install or update Vega Prime this file is likely to get overwritten


* 112  *  Does Vega Prime Support the equivalent to  VGOBJ_CLONE top


    Does Vega Prime Support the equivalent to  VGOBJ_CLONE

    Vega Prime 1.x does not support an object clone method. How ever you can do this yourself quite easily by do the following 

    • Create your initial vpObject  we use this as your template
    • RefCount  the vpObject
    • Then for each clone instance you want
      • Create a vpTransform
      • Add the template object as child of the vpTransform 
      • now the vpTransform is your clone

    In Vega Prime 2.0 its now easier to do, as a new function was added vpObject::setCopySource(...), that is the direct equivalent to the old Vega  VGOBJ_CLONE


* 113  *  How can I Do an Intersection with a Particle Effecttop


    Unfortunately with Vega Prime 1.x/2.0 you cannot currently perform an intersection test with Vega Prime based particle effects.


    One rough work around is to:

    • Create a Bill Board or Bounding Box or Bounding Sphere that Encompasses the Particle effect.
    • Set the render mask on this bounding geometry so that it is not rendered
    • Set the isector mask on the this bounding geometry
    • Add this as child of the Particle effect


    The bounding geometry is in the scene but not drawn which means you can intersect with it


* 114  *  How Can I find a Particular Face from my OpenFlight Filetop


    Unfortunately there is really no easy way to do this as Vega Prime or most other Scenegraphs as the do not load or store any name attributes of faces

    There also no guarantee that your face would survive in its original form, as it may become part of a triangle strip, array etc when the file is load and optimized.

    On crude way would be to have the Triangles/faces of interest modeled with one per group, then you could retrieve the face attributes in Vega Prime as long as there file was not optimized.


* 115  * Can I use Line breaks in vsStringstop

    Unfortunately no, currently Vega Prime 1.x/2.0 does not support the use of Line Breaks ('\n') in vsStrings

    You will have to uses seperate strings for each line


* 116  *  How do I get the Application Window Handletop


    This pretty straight forward, here's an example of how to do this on Windows ( On Irix and Linux just replace, HWND with the correct windows structure )

Code :



    HWND hWnd = NULL;

    vpWindow *window = ( *vpWindow::begin() );

        if( *window != NULL ) {

            hWnd = *window ->getWindow());

        if( hWnd == NULL )





* 117  * How Can I use Windows Send/Post Messages with Vega Prime top


    This should be pretty straight forward, here's a possible way to do this


Code :



    HWND hWnd = NULL;

    vpWindow *window = ( *vpWindow::begin() );

        if( *window != NULL ) {

            hWnd = *window ->getWindow());

        if( hWnd == NULL )



    SendMessage( hWnd, WM_SYSCOMMAND, _MESSAGE ID,  _VALUE ));

    PostMessage( hWnd, WM_SYSCOMMAND, _MESSAGE ID,  _VALUE ));




* 118  *  Where are Opengl State Calls Made in Vega Primetop

    In VSG  it is the virtual vsCullRecord::processDraw method that applies the Opengl State to geometry that is drawn through Render Strategies

    The method checks the m_bLoadState flag and applies the state if it is not NULL. note, set the state to NULL on the geometry node if you don't want the state applied.

    Render strategies only deal with "geometry" commands. You can, however, issue "state" commands within the strategy as well.

    You can also consider deriving a new cull record / factory type and setting it on the geometry node. This way you get to control both methods of state applying. Take a look at the "Extending VSG" white paper for details on how to achieve this

* 119  *  How Can I Make an vpObject Transparenttop

    There are several possible ways to make an object transparent.

    Transparency may come from the Vertex color, Texture, or Material. Vega Prime will pick up these from the OpenFlight file. thus there is nothing special that you need to do at runtime if you have model it that way

    Now if you want to modify what you've already modeled in your runtime application . then depending on the modeling technique, you will need to access the corresponding attribute at runtime in Vega Prime.

    The Vertex color is stored in the color attribute of vrGeometry, the Texture and Material attributes are stored in a vrState, Therefore you will need to perform a scene graph traversal (or get hold of the geometry node somehow else), access those objects via the corresponding API calls (see vsGeometry), and then modify the corresponding attribute.

    Its worth noting that some of the changes may not be multi-thread safe!!! , the vsgs_dynamic_geometry sample shows how to make it multi-thread safe).

    The vp_flight_path web sample demonstrates how to "ghost" an entire object. In a nutshell, the sample implements a scene graph traversal that modifies vertex alpha and attaches alpha blend element to the state of the object


* 120  *  I'm Using VP Distributed but my Slave Objects are Not Updatingtop


    I have successfully setup my distribute my application but the models in my code are only being moved on the master computer and not on the slaved machines

    You will need to tell the slaves to update the vpObjects, see the function vuDistributed::sync

    Also see the following sample



* 121  *  Uhh I get a Warning convColor : Color Hue <***> is out of range <**>- Forcing WHITEtop


    If you are getting a warning message along the lines of: 

    warn -> convColor : Color Hue <65025> is out of range <0..1024> - Forcing WHITE POLYGON

    The color hue warning refers to possible corruption in the packed color indices of the flt file. The easiest way to get rid of the warnings would be to switch from indexed colors to RGB mode

    In Creator or your modeling package edit the header of the database node of your flt file, check the RGB mode checkbox.

    Or try and update the colour indices again in Creator


* 122  *  Can I use 3ds Max or Maya File in Vega Primetop


    Unfortunately as of Vega Prime 2.0 You cannot directly use files create in Maya or 3ds Max

    You will need to first translate your models to a supported format such a OpenFlight using a third party product such as Polytrans or Deep Exploration. See ( FAQ 108 )

    There are also some plug-ins to Maya and 3ds Max to output OpenFlight files which you can then use in directly Vega Prime, try a google to find them


* 123  *  Can I Create My Own Motion Modeltop


    Yes you can create your own Motion Model in Vega Prime

    You can write your own from scratch, you can derive from vpMotion base class and you can even derive your motion model form one the motion models provided in Vega Prime


    If you cannot find this sample contact MPI support as it may have been moved to their support only samples


* 124  *  What Happened to vsSequencetop


    Vega Prime 1.0 and 1.1 supported a class and node type called vsSequence.

    The vsSequence class and node were removed in Vega Prime 1.2 to be replaced with the vsAnimation calls and node which provides the same functions and methods.


* 125  *  How to Set the Loop Duration of Animation in Vega Primetop


    You can do some thing along the lines of in Vega Prime 1.x



Code :



    vsNode* node = NULL;


    vpObject* obj = vpObject::find("_object_name_");


    if( obj == NULL ) return;


    node = obj->findNamed("Your_animation_name");


    if( node == NULL ) return;



    // Once you have the node found your named ,  you need to check it is of

    // the type vsAnimation



    if ( node->getClassType()  !=  vsAnimation::getStaticClassType()) return;




    // Now grab a pointer to the correct node type


    vsAnimation* aniNode = static_cast< vsAnimation * >( node );




    // Once you have a vsAnimation pointer you set the duration


    // 16.6 ms per key frame



    double duration = 1.0 / 60.0;


    aniNode->setDuration( duration );




    See the vsAnimation documentation for more information 

    Note that vsAnimation was called vsSequence in Vega Prime 1.0 and 1.1

    Note in Vega Prime 2.0 ::findNamed(...)  has been changed to ::find_named(....)


* 126  *  Does Vega Prime Support P-Bufferstop


    Yes Vega Prime does support P-Buffers

    Vega Prime 2.0 added direct support for off screen P-Buffer Rendering

    Vega Prime 1.x does not offer direct support of P-Buffers


* 127  *  Does Vega Prime Support 3d Texturestop


    Yes Vega Prime does directly support 3d textures as of the release of Vega Prime 2.0

    Vega Prime 1.x does not directly support 3d textures, although you can use them via Opengl in a draw call back etc.


* 128  *  Does Vega Prime Support Stereo Rendering  top


    Yes Vega Prime does support 2 Left & Right stereo rending as of the release of Vega Prime 2.0

    In order to use stereo capability, it is required that the stereo feature be enable and the graphics card must be capable of rendering in stereo and many PC base cards need to be placed into stereo mode out side of Vega Prime


* 129  * What Happened in to ::FindNamed() functions top


    Well for some unknown reason MPI in the Vega Prime 2.0 release decided to change the name of the function findName(..) to find_name(..)

    This is the type unnecessary API change that drive me nuts, it breaks my code and there really no good reason to it, as this breaks every customer code that use the function. Annoying Annoying and node needed


* 130  * How to check if a vpObject is within a vpChannel's FOV top


    You can do something along lines of : 

    • Get channel frustum
    • Compute object's bounding sphere in camera/view space
    • intersect bounding sphere against the frustum. ( See vuVolume )

    Note it is important that both the frustum and the bounding sphere are computed in the same reference frame (either world or camera).

    MPI may have a sample so contact Support to see if they have


* 131  *   Changing the Channel Position Leaves Artifacts top


    I have vpChannel object in vpWindow, I  want to move it dynamically using say the arrow buttons. However it seems that vpWindow object redrawing only channel area so when I'm updating channel position I get  artifacts that do not disappear. 

    technically the vpWindow class does no do any drawing at all,  It just provides the graphics context and canvas

    The drawing is done by the vpChannel instances which define a region to draw into, the region is the only thing a channel can clear. That's why we can overlay channel etc..

    One quick and dirty method would be to created an extra  dummy channel

    The new dummy channel is then sized such that it fills the whole of the window and has an empty  scene and observer attached as we need the channel to be cleared for us,  there is little or next to no overhead from this

    Then your the second, third channels etc  are then size and positioned as normal, you can then move these other channels around with out the artifacts being left behind


* 132  *  Can I use the Stencil Plane in Vega Primetop

    Here's an Example  of using a Stencil buffer in Vega Prime provided by  'Chas Whitley'

Code :



    virtual void

    notify( vsChannel::Event event, const vsChannel *channel, vrDrawContext *context){

    vrStateMgr *stateMgr = context->getStateMgr();

    if( event == vsChannel::EVENT_PRE_DRAW ) {

        vrTransform::ElementProjection elementProjection;

        vrTransform::ElementModelView elementModelView;

        channel->getVrChannel()->setClearColor(0.0f, 0.0f, 0.0f, 0.4f);


        stateMgr->pushAll(context, true );

        elementProjection.makeOrthographic(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);

        stateMgr->setElement (vrTransform::ElementProjection::Id, &elementProjection, context);

        stateMgr-->setElement(vrTransform::ElementModelView::Id, &elementModelView, context);

        glDisable( GL_DEPTH_TEST );

        glClearStencil( 0 );

        glClear( GL_STENCIL_BUFFER_BIT );;

        glStencilFunc ( GL_ALWAYS, 0x1, 0x1);

        glStencilOp ( GL_REPLACE, GL_REPLACE, GL_REPLACE );

        glEnable( GL_STENCIL_TEST );

        gluDisk( quadric,0.0,1.0,100,1);

        stateMgr->popAll(context, false);

        glStencilFunc ( GL_EQUAL, 0x1, 0x1);

        glStencilOp ( GL_KEEP, GL_KEEP, GL_KEEP);

        glEnable( GL_STENCIL_TEST );


    else if( event == vsChannel::EVENT_POST_DRAW ) {

        glDisable( GL_STENCIL_TEST );


    } //  notify




* 133  *  How can I keep my Vega Prime Window on Toptop


    On a Microsoft Windows Based system you could do something like:

Code :



    vpWindow *pWin = ( *vpWindow::begin() );

    int h = 0, int w =0;

    pWin->getSize( &w, &h );

    HWND hWnd = pWin->getWindow();

    SetWindowPos( hWnd, HWND_TOPMOST, 0, 0, w, h, SWP_NOMOVE | SWP_NOSIZE );




* 134  * How Can I Move my Vega Prime Window to the Top top


    On a Microsoft Windows Based system you could do something like:


Code :



    vpWindow *pWin = ( *vpWindow::begin() );

    HWND hWnd = pWin->getWindow();

    SetForegroundWindow( hWnd );



* 135  *  Why is the SkyDome All Screwy when I at a High Altitudetop


    Basically the SkyDome is currently Broken in Vega Prime.

    Why is the Sky-Dome All Screwy when I have a High Altitude

    While the sky-Dome is centred correctly positioned at the observer's X Y position, it's Z is currently always 0. This is a known issue to MPI, but as yet they have not fixed the problem

    This is a real issue for most high flight applications, and will be worse the smaller your far-clip plane is

    There is no real work around or fudge, MPI suggest pushing the far-clip out as this scales the sky-dome and thus will scale the Z. But this will effect the visual appearance of the clouds etc. and will effect your Z buffer by reducing  its precision and you will probably have to draw more as well if you push the far-clip out

    Best course of action is to shout at MPI to fix the BUG.... MPI say this has been fixed in VP2.0 I still find it to be broken though


* 136  *  How Can I Group vgObjectstop


    I have a set of vgObjects that I would like to moved around etc as a group, in Vega Classic I could have used a vgPlayer, but how do I do this in Vega Prime.

    This is really easy in Vega prime and a lot easier than in Vega Classic, simply use and create a vpTransform then add the vpObject as children to the new vpTransform node.

    Now you can move the vpTransform node, attach it to motion strategy, attach it to vpNavigator and the objects will stay positioned relative to the vpTransform

    Also the really good thing is that you can easily reposition the vpObjects that are parented to the vpTransform, unlike old Vega Classic vgPlayer

    Also see the Vega Prime FAQ 79


* 137  * How Can I Pick Something in Vega Prime top


    Contact MPI support department and request the sample called vp_picker which shows you how to create a basic picking class.

    In Vega Prime 2.0 see the header vgEventPicker.h this uses a simple version of the code found in vp_picker

    Note neither of these provides much of the extra useful functionality you could find in the vgPicker and Vega PickFly motion models, they are simply a basic pick event


* 138  *  Where is the Equivalent to vgPicker  in Vega Primetop


    Vega Prime 1.x does not provide any direct equivalent to the vgPicker class found in classic Vega

    MPI does have a simple picking sample written when I still worked at MPI called vp_picker, contact MPI support and ask for this sample.

    In Vega prime 2.0 vgEventPicker.h provide an even simpler picking ability.

    Note neither of these provides much of the extra useful functionality you could find in the vgPicker and Vega PickFly motion models, they are simply a basic pick event


* 139  *  Should I Use Multiple Windows or Multiple Channelstop


    One Window with Multiple channels is better than Multiple Windows with a channel per windows

    (more info to follow )


* 140  *   Can I Limit process Shown by the 'drUtil' Tooltop


    Vega Primes Distributed Rendering module provide a tool called drUtil, this tool allows the use to display all the process running on the system ( similar to the Windows Task Manager)

    Is it possible to limit the process it shows, as the tool allows you to attempt to delete any of the listed process, which can cause many problems to say the least

    Unfortunately there is no way currently in Vega Prime to limit which processes are shown ( as of Vega Prime 2.0 )


* 141  *   How to Load Files from Another Threadtop


    I want to load files for my application in different thread threads, how can I achieve this in Vega Prime

    There are several  ways to solve this problem, two  of which could be:

    • You could use asynchronous loading method that is already built into Vega Prime, whish means very little work on your part
    • You could implement your own paging service, which is more work than the previous methods. Contact the MPI support and ask for the vsgs_paging_service sample, this sample illustrates how to configure an asynchronous paging service


* 142  *  Does Vega Prime Provide any Shadowing Capabilitiestop


    Vega Prime 1.x does not offer any direct support for creating and using shadows, although as normal you can write you own code to do this

    While Vega Prime 2.0  provides the technique of "Planar Shadows"

    Planar shadow is a quite simple technique that allows the shadow caster to be projected onto a surface along the direction of the light source.

    Not one of the artefacts/problems with this technique is that If the shadow moves from one plane/surface to another you will see some shadow discontinuity when the slope of one plane changes with respect to the other plane.

    While this shadow technique is inexpensive, like all other techniques for producing shadows, it has its side-effectsVega Prime 1.x does not offer any direct support for creating and using shadows, although as normal you can write you own code to do this


* 143  *  Can I change the Cursor Shape in a Vega Prime Windowtop

    Yes you can but you cannot do this directly through Vega Prime , as the cursor is tied directly to the GUI kit you are using, so the remit to change the shape fall sdown to the GUI API and SDK.

Code :



    HCURSOR m_myCursor = LoadCursor( hinst , MAKEINTRESOURCE ( IDC_CURSOR_MY ) );

    ::SetCursor( m_myCursor );



* 144  *  How to get the vpPipeline of a vpWindow top


    While, a Vega Prime pipeline knows about its Vega Prime windows,  a window does not know about its pipeline.

    Therefore, you need to iterate over all pipelines and search for one that has the window, something along the lines of the code below:

Code :


    vpPipeline* pipeLine = NULL;

    vpPipeline::const_iterator iterPipe    = vpPipeline::begin();

    vpPipeline::const_iterator iterPipeEnd = vpPipeline::end();


    for( ; iterPipe != iterPipeEnd; ++iterPipe ) {

        if( pipeLine != NULL ) break;

        vpPipeline::const_iterator_window iterWin    = (*iterPip)->begin_window();

        vpPipeline::const_iterator_window iterWinEnd = (*iterPip)->end_window();

        for(; iterWin != iterWinEnd; ++iterWin )

             if((*iterWin ) == myWindow ) {

                  pipeLine = *iterPipe;




    // if the pipeLine is not NULL, then you have found the pipeline




* 145  *  Can I Change an Embedded Vega Prime Windows Parent  top


    It is really not possible to dynamically change the parent of an embedded Vega Prime Window.

    One work around that I can thing of would be to use a dummy window that is to create an extra window/widget that holds the Vega Prime window, this way you can reparent the dummy window and bring the Vega Prime window along with it, you may have to also make sure about route windows messages correctly


* 146  *  Can I Use a Splash Screen Like Vega Classictop

    Unfortunately Vega Prime does NOT provide a Vega Classic Splash Screen.

    If you want to have a splash screen in Vega Prime then you are going to have to create you own.

* 147  *  How do I Compile Vega Prime Staticallytop


    There are several steps that you have to follow in order to statically compile a Vega Prime based application

    See the sample that is shipped with Vega Prime  can be found at:


    This sample will show you how to set up your makefile's, work spaces  and how to include loader formats in order to be able to compile statically

    If you cannot find this sample then contact MPI support directly ( but it is a shipped sample )


* 148  *  How can I transform my Mouse from Screen to World Coordinatestop


    We can do this by using code along the lines of

    We need transform the mouse position  which is in normalized channel  screen space, back into world space.  

    In order to accomplish this,  we need to undo"the projection and graphics library specific offset transformations by transforming the point through the inverse of their respective matrices.  

    This gives us the mouse position in the eye's coordinate system.  Then a final transformation through the view matrix will put us into world coordinates.  

    Note that in the initial transformation that the Z coordinate really does not matter since the inverse of the projection transformation ignores it

    mx and my are is the position of the mouse in channel  coordinates

Code :


    vpChannel *channel = (*vpChannel::begin());

    vuMatrix < float > projInverse;

    vuVec3 < float > mousePos( mx,  my, -1 );

    projInverse.invert( channel->getVrChannel()->getProjectionMatrix());

    projInverse( &mousePos );

    channel->getVrChannel()->getOffsetMatrixInverse().transformPoint( &mousePos );

    channel->getVrChannel()->getViewMatrix().transformPoint( &mousePos );



    The Mouse position ( mousePos ) is now in world space coordinates


* 149  *  How do I Calculate the Vertical Field of Viewtop


    I know that Vega Prime will calculate the Vertical Field of View if I give the Vega Prime channel a Horizontal field of view and pass -1 for the vertical field of view

    Here's one way that you could do this is along the following lines:


Formula :


    aspect_ratio = channel_width / channel_height

    width = tan ( horizontal_fov / 2.0 ) * 2.0 * near_clip

    height = width / aspect_ratio

    vertical_fov =  2.0 * atan(  height / ( 2.0 * near_clip  ))




* 150  *  How do I Calculate the Horizontal  Field of Viewtop


    I know that Vega Prime will calculate the Horizontal Field of View if I give the Vega Prime channel the Vertical field of view and  pass  -1 to the Horizontal field of view

    Here's one way that you could do this is along the following lines:

Formula :


    aspect_ratio  =  channel_height / channel_width

    height = tan ( vert_fov / 2.0 ) * 2.0 * near_clip

    width = height / aspect_ratio

    horizontal_fov =  2.0 * atan( width / ( 2.0 * near_clip  ))






Copyright 2005-2006 Gordon Tomlinson  All Rights Reserved.

All logos, trademarks and copyrights in this site are property of their respective owner.