2006-12-23

Phoeeb Deform

Brand new video, made almost from scratch (a stock photograph from deviantart was used as a referenced and applied as a texture).





Phoeeb Deform from binarymillenium on Vimeo.




The music is from ccMixter (http://ccmixter.org/media/files/vincent_vega11/6966), which has supplied me with several good soundtracks for recent videos, although it can be difficult to browse the music- where's the sort by rating button? I recall another CC music site less focused on remixing and more on original works that had more movie like soundtracks I'd like to use in the future but I forget the site.

2006-11-29

Deriving The Rocket Equation


This is probably a job interview question somewhere. I was just thinking about it
and decided to try it out myself, with no regard to convention beyond what is already intuitive for me.

The question is, you have rocket with a certain amount of mass, some of which is fuel. The rocket consumes fuel at a constant rate in order to produce a constant thrust. If the rocket starts at time zero, how fast is it going and what is its displacement at some later time?

So the lets say the fuel consumption rate is a positive number k, in units of kg/sec.
The fueled mass of the rocket is Mo.
Therefore the mass at a later time t is
M(t) = Mo - kt

From physics it is known that F=MA. Our F is constant, we'll just call it F, its units are kg*m/s^2. Acceleration is the thing that will change, intuitively acceleration should increase as the mass goes down as fuel is consume.

A= F/M = F/M(t) = F/(Mo - kt)

Looking at that equation makes sense- the denominator gets smaller therefore A goes up as time increases.




So the trick to finding velocity is integrating that curve and position is found by integrating again. Easy numerically, but of course we want a nice analytical answer.

I've forgotten a lot of the little tricks of calculus, which is just as well since I want to solve this as intuitively as possible anyway. The most I did lookup to remind myself was to find that the integral of 1/x is ln(x) and that ln(x/y) = ln(x) - ln(y), and that to have definite integral over a specified interval (time 0 to time t1 here) you can subtract the indefinite integral of the lower bound from the indefinite integral of the higher bound.

We don't have a 1/x equation, at first glance, we have a 1/(constant- x) equation- so how do you integrate that? The trick is to make our equation into the form of 1/x.

1/x backwards to our acceleration graph:

So we need to reverse our graph to make it look like that and then we'll have the integral. Instead integrating with respect to time, we'll integrate with respect to (Mo-kt) and do it from the lower bound Mo-ktf (tf is the final t) to Mo (Mo - k to, to is zero so it's just Mo).

So we end up with

Integral of F/(Mo-kt) d(Mo-kt) = F * Integral of 1/(Mo-kt) dkt
(since Mo does not change the interval d(Mo-kt), it drops out). Unfortunately the units of this integral is going to be kg*m/s^2 * 1/kg * kg/s * s (the units of the F times the units of the 1/ mass times the units of the k times the units of the t) = kg*m /s^2 - we want velocity not force! In order to cancel out the k in dkt inside the integral we divide F by k outside of the integral.

f/k units is m/s - a velocity which we should return to later.

f/k * ( ln(Mo) - ln (Mo - ktf) ) = f/k * ( ln (Mo/(Mo - ktf)) )

Or if we say Mf = Mo - ktf, then v(t) = f/k * ln(Mo/M(t)).

Exhaust Velocity

Going slight further in, we should look at what is happening in order to accelerate the rocket. Rockets operate by throwing mass out the back end at a high velocity- throwing out a little bit of mass a high velocity adds a little velocity to your rocket with a big mass- and there's an equation of momentum to show
how those four things are related:

m1 * deltaV1 = m2 * deltaV2

We know we're burning m1 = k amount of fuel every second, and that since we're not doing any nuclear reactions the k amount of fuel is still there in mass form- it's just moving out the back end at high velocity. We know the mass of the rocket Mo or M(t) and its acceleration (delta-v) for that moment is a(t). So we have three of the four quantities, the delta-v of the exhaust fuel is what we want. Since the exhaust velocity doesn' t change we can just use Mo = M(0) and a(0)*1 second = F/Mo*1second (to simplify we assume that acceleration doesn't change much over 1 second).

m2*deltaV2 / m1 = deltaV1
Mo*F/Mo* 1sec / ( k * 1sec ) = deltaV1
exhaust velocity deltaV1 = F/k - the same f/k in the above rocket equation. So instead of saying f/k we can say 'exhaust velocity'.

2006-10-06

Googlepages Test

I'd like the columns to take up more than the current width, but I don't think it's possible.

Embedding video is a little funky, when I went to three columns it had problems putting in the video in anything but the center 'main content column'. If I can fatten up the single main column I can use the edit html to make my own columns- ideally there would be videos in a grid 3 videos wide, or at least two wide.

2006-07-08

parse error at end of input

I got that error out of gcc 3.3.4 when I forgot a parentheses:


for (unsigned i = 0; i < troops.size(); i++) {
if (troops[i]->active) { troops[i]->update(timestep);
}


It gives the last line in the file as the line number, so it's not an easy one to track down.

2006-07-05

DVD Chapter markers in FCP + iDVD

I finally learned how to create dvd chapters in Final Cut Pro and iDVD (at least the 2006 version). Pressing the 'm' key, or the '`' key, or going up to the marker menu will add a mark, but you also have to make sure it adds a designation (anyway to do that by default?)- the easiest thing to do is press the '`' key and then the dialog that has a 'add chapter' button is right there, otherwise it takes additional steps.

iDVD, upon importing the exported video (and I think it can be exported as nearly anything in the quicktime export option and the proper markers will survive) will create a 'play movie' and also have a button for selecting chapters from a auto-generated screen full of chapters. You can then change what picture or clip of video is shown for that submenu, but it's not frame-accurate- trying to scroll with the mouse (especially for a longer video) or pressing the left and right arrow keys usually jumps many frames forward or back.

There's also the 'best quality' vs. 'best performance' option, I couldn't fit a 70 minute video with 'best performance' enabled so I had to change it from that default. I probably wanted 'best quality' all along anyway but I didn't know about it until it complained about the length of the video under the old option.


DVD Studio Pro

I have tried making a video with DVD studio pro, mainly to be able to create chapters before I knew the above steps, and also because an earlier version of iDVD was not exporting the 16:9 video correctly- it would look normal widescreen for five minutes and then it squeezed the video a little so there would be black vertical bars on each side. Strange...

DVDSP isn't that hard to use, but it has a major failing for me: it can only use HD video if a HD dvd is being made. iDVD will automatically recode most any video thrown at it, but here an additional very time consuming step is added, one has to export the video from FCP in a SD format ( I chose DV50), the 16:9 aspect ratio won't survive the export but in DVDSP there's an option to force the video back to 16:9. But it's a huge pain to have to do that extra export.

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.

2006-05-19

Beast Please Be Still at Chop Suey

Beast Please Be Still (or here) call themselves "a nine piece instrumental landscape from Seattle. A collection of emotive story-telling, the music of this collabrative sounds like an orchestra of beautiful, post-everything."



There's a lot of shaky camera work I could have covered up with editing, while still preserving the sound of the entire set... but that would have been too much work.

The Chop Suey venue seemed decent, though for the size of this band the stage was crowded, I couldn't see a few people because the lights weren't on them or they were behind too many other people. The stage is also too recessed rather than jutting out into the crowd space, contributing to the difficulty in seeing the band.

youtube video from someone else of the same show. It's also edited down. I was scooped by a couple of days...

2006-05-14

Ms. Led wmv vs. mpeg2 uploads to google video


The mpeg2 version above.



The wmv version

The two both look poor when viewed with the embedded player, but downloading the video shows that the mpeg2 version is far superior. It takes a lot longer because the files are so much bigger, but I'm not uploading anything bigger than a few minutes long.