Present3D Help
P3D solutions for current problems
Alpha
1) to enable alpha channels for an image or movie, you need to set the fade to a value less than 1 so:
fade="0 0.999"
<!-- nebula movie -->
<slide>
<duration>25.0</duration>
<background></background>
<title></title>
<layer>
<model coordinate_frame="slide" scale="250" position="0.5 0.5 0" fade="0 0 1 1" rotate="60 1 0 0">starfield2.osg</model>
<stereo_pair fade="0 0.999" position="0.5 0.5 0" rotate="0.01 1 0 0" scale="1">
<image_left region="0.0 0.0 0.5 1.0" >stereoMovies/nebulaLA0.5.mov</image_left>
<image_right region="0.5 0.0 1.0 1.0" >stereoMovies/nebulaLA0.5.mov</image_right>
</stereo_pair>
</layer>
</slide>
.
Transparency problem solutions for models with textures with alpha channel.
This applies to movie to or single file textures with alpha channel. Generally alpha textures look blocky or flicker. To get round this the model file must be converted to .osg file and edited. Below is example of requires information in osg file:
Geometry {
DataVariance DYNAMIC
StateSet {
UniqueID StateSet_0
DataVariance STATIC
rendering_hint TRANSPARENT_BIN
renderBinMode USE
binNumber 10
binName DepthSortedBin
GL_CULL_FACE ON
GL_LIGHTING ON
GL_BLEND ON
Material {
DataVariance STATIC
ColorMode OFF
ambientColor 0 0 0 1
diffuseColor 0.8 0.8 0.8 1
specularColor 0.5 0.5 0.5 1
emissionColor 0 0 0 1
shininess 64
}
BlendFunc {
DataVariance STATIC
source SRC_ALPHA
destination ONE_MINUS_SRC_ALPHA
}
textureUnit 0 {
GL_TEXTURE_2D ON
Texture2D {
DataVariance STATIC
file "radio.mov"
The entries in purple relate to transparency settings. If you convert from .flt file using osgconv most of the values should be correct except GL_CULL_FACE OFF needs to be converted to ON. If the .osg file is converted from a different format eg .obj or via blender more of the settings may need to be changed.
2) a recent issue with movies with alpha has been solved by introducing a small rotate to the movie :
rotate="0.01 1 0 0"
but it only works, with the rotation in the x as above, see above example also.
Rotation of models on import using osgconv or rot plugin
osgconv
-o orientation - Convert geometry from input files to output files.
Format of orientation argument must be the following:
X1,Y1,Z1-X2,Y2,Z2
or
degrees-A0,A1,A2
where X1,Y1,Z1 represent the UP vector in the input
files and X2,Y2,Z2 represent the UP vector of the
output file, or degrees is the rotation angle in degrees
around axis (A0,A1,A2). For example, to convert a model
built in a Y-Up coordinate system to a model with a Z-up
coordinate system, the argument may look like
0,1,0-0,0,1
or
-90-1,0,0
.
An example of it in action is a rotation of 90 degrees about the z axis:
osgconv cow.osg -o 90-0,0,1 test.osg
For Maya models you'll want something like:
osgconv cow.osg -o 90-1,0,0 test.osg
rot psuedo plugin
There is also the rot psuedo plugin which you can use like:
osgviewer cow.osg.90,0,0.rot
Which does a rotation by 90 degrees about the x axis. The parameters are rotation-X, rotation-Y, rotation-Z.
You'll be able to us the rot plugin in conjunction with the P3D xml file format, so instread of references cow.osg you just reference cow.osg.90,0,0.rot. The nice thing about this is you don't need to modify the file itself.
Applying a Movie to a Model:
Convert the .obj file to a .osg by using the osgconv function:
%osgconv file.obj file.osg
now open the file.osg file in BBEDIT and search for - file "picture.jpg" or, file "picture.png" if using alpha channels, and replace with full path to .mov file that you want use.
Note that movies need to be flipped horizontally and vertically to appear correctly - this can be done in Quicktime.
LWS file format
http://www.newtek.com/products/lightwave/developer/LW80/8lwsdk/docs/filefmts/lwsc.html
To remove unwanted animation from a .lws file create a .osg file by using osgconv :
$ osgconv file.lws file.osg
Then open the osg file in BBEDIT and search for :
this will probably be set to 1
use the replace all function to change all to :
timeMultiplier 0
Don't Use AGL version of P3D 1.2 - use X11 version
% make USE_AGL=no
Or set an env var:
% setenv USE_AGL no
% make
Comments (0)
You don't have permission to comment on this page.