|
      
|
|
|
|

|
|
|
|
51
What 3d model file formats does Vega Support 
|
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 Vega
|
|
|
|
53
Can I use Borland C++ Builder with Vega NT 
|
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:
|
|
54
Can I use Vega in MFC
|
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 
|
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
- You can use vgCreateConsole();
- Or you could create your own console using AllocConsole();
|
Code :
|
--
|
if( AllocConsole() ){
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 
|
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 
|
No there is no COM interface for VegaNT, ( Vega Irix does have a TCL/TK interface )
|
|
58
Can I use Vega with Tcl/TK 
|
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 
|
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 
|
- 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
|
|
61
How do I change a Vega class property 
|
- 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
|
|
62
How do I set a property on vgSystem before
|
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 
|
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
|
|
64
How do I delete an vgObject 
|
To delete a vgObject simply use the vgCommon function vgDelete( vgCommon *handle ); For example :
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 
|
- 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 
|
- 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 
|
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;
obj = vgGetObj( 0 );
pos = vgNewPos( );
vgGetPosVec( pos, &x, &y, &z, &h, &p, &r );
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 
|
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 
|
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;
obj = vgGetObj( 0 );
pos = vgNewPos( );
vgGetPosVec( pos, &x, &y, &z, &h, &p, &r );
x = x + 10.0f;
y = y + 20.0f;
z = z + 30.0f;
vgPosVec( pos, x, y, z, h, p, r );
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 
|
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;
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;
obj = vgFindObj( "Blue Car" );
w1 = vgFindPartOccurence ( obj, "wheel", 1 );
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 vgPart
|
|
|