Commit 5f3984e3 authored by fpa's avatar fpa

replaced function normr() of Neural Network Toolbox by manual code

parent c794dd0e
......@@ -52,8 +52,15 @@ if abs(dot(v,u,2)) > 1e-5
end
% normalize view/up vectors
v = normr(v);
u = normr(u);
[~,colv]=size(v);
[~,colu]=size(u);
if (colv == 1)
v(~isnan(v(:,1)),:) = v(~isnan(v(:,1)),:) ./ abs(v(~isnan(v(:,1)),:));
u(~isnan(u(:,1)),:) = u(~isnan(u(:,1)),:) ./ abs(u(~isnan(u(:,1)),:));
else
v = sqrt( ones ./ (sum((v(~isnan(v(:,1)),:).*v(~isnan(v(:,1)),:))')) )' * ones(1,colv).*v(~isnan(v(:,1)),:);
u = sqrt( ones ./ (sum((u(~isnan(u(:,1)),:).*u(~isnan(u(:,1)),:))')) )' * ones(1,colu).*u(~isnan(u(:,1)),:);
end
% calculate side vector
s = cross(v, u);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment