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>
.
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 :
Comments (0)
You don't have permission to comment on this page.