2006-06-08

osgClouds

Modified osgforest example to produce this simple cloud layer in osg:

image hosting by imagevenue.com

With this code (provided here under the GPL):


void ForestTechniqueManager::createTreeList(osg::Node* terrain,const osg::Vec3& origin, const osg::Vec3& size,unsigned int numTreesToCreate,TreeList& trees)
{

float max_TreeHeight = 15*sqrtf(size.length2()/(float)numTreesToCreate);
float max_TreeWidth = max_TreeHeight;

float min_TreeHeight = max_TreeHeight*0.3f;
float min_TreeWidth = min_TreeHeight;

trees.reserve(trees.size()+numTreesToCreate);

float ceil = origin.z()+900.0f;
float floor = origin.z()+300.0f;

for(unsigned int i=0;i {

Tree* tree = new Tree;
tree->_position.set(
random(origin.x(),origin.x()+size.x()),
random(origin.y(),origin.y()+size.y()),
random(floor,ceil)
);

float colorFactor = (tree->_position.z()-floor)/(ceil-floor);
colorFactor = 0.3 + colorFactor*(1.0-0.3);
int color = (int) ((1.0 - (1.0-colorFactor)*(1.0-colorFactor) ) *255.0);


tree->_color.set(
color, color, color,
255
);


tree->_width = random(min_TreeWidth,max_TreeWidth*(1.3f-colorFactor) );
tree->_height = random(min_TreeHeight,max_TreeHeight*(1.3f-colorFactor) );
tree->_type = 0;

//if (terrain)
if (0)
{
osgUtil::IntersectVisitor iv;
osg::ref_ptr segDown = new osg::LineSegment;

segDown->set(tree->_position,tree->_position+osg::Vec3(0.0f,0.0f,size.z()));
iv.addLineSegment(segDown.get());

terrain->accept(iv);

if (iv.hits())
{
osgUtil::IntersectVisitor::HitList& hitList = iv.getHitList(segDown.get());
if (!hitList.empty())
{
osg::Vec3 ip = hitList.front().getWorldIntersectPoint();
osg::Vec3 np = hitList.front().getWorldIntersectNormal();
tree->_position = ip;
}
}
}

trees.push_back(tree);
}
}

2006-06-04

HDV to DVD

Exporting 1080i video from FCP is not a good idea if the video is going to going to iDVD. iDVD doesn't deinterlace it itself even though it converts it down to standard definition.

I'm not sure about this, but I think it's best to make the sequence settings set to the resolution desired as well as selecting the right compression when exporting- this will ensure that the aspect ratios are correct and what you see in the output window is mostly correct.

Of course, exporting to HDV 1080i when the source is HDV 1080i is relatively fast, any conversion is not going to be speedy. While editing, it's best to have the timeline in the same settings as the source clips, otherwise FCP will try to convert it on the fly and give a poor quality RT preview or simply say 'unrendered'.

I've ran into a few glitches with this process: On one project, dropping the HDV 720p files into iDVD (from iLife '05) results in the proper anamorphic 16:9 'enhance for wide-screen tvs' type video. Previewing the video in iDVD and everything looks right- the video fills the entire 16:9 preview box. But after burning it, only the first 10 minutes or so is the proper format- although the video is still in 16:9 anamorphic, for some reason the video is squeezed horizontally by about 10%, leaving black bars on the side. This didn't happen on an edit or transition between different timelines, just right in the middle of a continuous shot. WTF?

Another problem, perhaps related to above, is that some text I thought would be on the bottom of the screen got chopped off- this I think is because the conversion from 1080i to 720p chopped some off, or that the glitch above not only squeezes the video horizontally but also stretches it vertically and then cuts off the botton.

So currently I'm googling for better processes to replace all this, one semi-promising one advises to export to DV50 at some point.