source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/missing-data/arbitrary_motion.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 571 bytes
Line 
1function [M, pts] = arbitrary_motion(nframes, npoints, trans)
2% This will produce a completely arbitrary motion sequence, in which each frame has
3% nothing to do with the previous one. 
4
5pts = rand(4,npoints);
6pts(4,:) = ones(1,npoints);
7% points have x,y,z coordinates, and a 1 in the 4th row for translation.
8
9R = [];
10for i = 1:nframes
11  r1 = random_normal';
12  % Produces a random unit vector.
13  temp = random_normal';
14  r2 = temp - sum(r1.*temp)*r1;
15  R = [R;r1;r2];
16end
17
18if trans
19  R = [R, 2*rand(2*nframes,1)-1];
20else
21  R = [R,zeros(2*nframes,1)];
22end
23
24M = R*pts;
Note: See TracBrowser for help on using the repository browser.