Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of various syntax errors #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mesh/readBDL.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@
fseek(fp, chunkSize, 'cof');
end
end
end
6 changes: 3 additions & 3 deletions mesh/tri2tgf.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ function tri2tgf(input_name,output_name)
[V,F] = load_mesh(input_name);
% Find all edges in mesh, note internal edges are repeated
E = sort( ...
[F(:,1) (:,2); ...
F(:,2) (:,3); ...
F(:,3) (:,1)]')';
[F(:,1) F(:,2); ...
F(:,2) F(:,3); ...
F(:,3) F(:,1)], 2);
% remove duplicates
E = unique(E,'rows');
writeTGF(output_name,V,E);
Expand Down
4 changes: 2 additions & 2 deletions mesh/udq2quattrans.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
-UDQ(2,1,:).*UDQ(1,3,:) + ...
UDQ(2,2,:).*UDQ(1,4,:) + ...
UDQ(2,3,:).*UDQ(1,1,:) - ...
UDQ(2,4,:).*UDQ(1,2,:);
UDQ(2,4,:).*UDQ(1,2,:));
T(:,3) = 2.0*( ...
-UDQ(2,1,:).*UDQ(1,4,:) - ...
UDQ(2,2,:).*UDQ(1,3,:) + ...
UDQ(2,3,:).*UDQ(1,2,:) + ...
UDQ(2,4,:).*UDQ(1,1,:);
UDQ(2,4,:).*UDQ(1,1,:));
end
14 changes: 7 additions & 7 deletions mesh/writeBDL.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function writeBDL(filename,V,F)
fwrite(fp, nBytes, 'int64');
end

function bundle = writeBDLMeshChunk(fp, mesh)
function writeBDLMeshChunk(fp, mesh)
% write a mesh chunk to a file stream that can be processed by the external
% viewer.
%
Expand All @@ -52,13 +52,13 @@ function writeBDL(filename,V,F)
end

nCperCol = 0;
if isfield(mesh,'col') nCperCol = size(mesh.col,2); end
if isfield(mesh,'col'); nCperCol = size(mesh.col,2); end

baseColor = [1,1,1,1];
if isfield(mesh,'baseColor') baseColor = mesh.baseColor; end
if isfield(mesh,'baseColor'); baseColor = mesh.baseColor; end

nCperUV = 0;
if isfield(mesh,'UV') nCperUV = size(mesh.UV,2); end
if isfield(mesh,'UV'); nCperUV = size(mesh.UV,2); end

nCperNormal = 0;
strip = 0;
Expand All @@ -78,9 +78,9 @@ function writeBDL(filename,V,F)
fwrite(fp, baseColor, 'float32');

fwrite(fp, mesh.V', 'float32');
if isfield(mesh,'UV') fwrite(fp, mesh.UV', 'float32'); end
if isfield(mesh,'col') fwrite(fp, mesh.col', 'float32'); end
if isfield(mesh,'F') fwrite(fp, mesh.F'-1, 'uint32'); % faces are 1-based in matlab
if isfield(mesh,'UV'); fwrite(fp, mesh.UV', 'float32'); end
if isfield(mesh,'col'); fwrite(fp, mesh.col', 'float32'); end
if isfield(mesh,'F'); fwrite(fp, mesh.F'-1, 'uint32'); end% faces are 1-based in matlab

chunkSize = ftell(fp) - chunkStart;

Expand Down