Commits

Martin Felis  committed 0924cfd

updated documentation

  • Participants
  • Parent commits e759134

Comments (0)

Files changed (6)

File doc/Mainpage.dox

 
 \par scale (3-d vector, default:  {1., 1., 1.})
 	Scales the model relative to its default size. A scale of {2., 2., 2. }
-	will draw the mesh twice as big as its default size.
+	will draw the mesh twice as big as its default size. Note that dimensions
+	takes precedence over scale.
 	
 \par dimensions (3-d vector, default:  {1., 1., 1.})
 	Scales the mesh so that its absolute size (more precisely its bounding
-	box) is that of dimensions.
+	box) is that of dimensions. Note that dimensions takes precedence over
+	scale.
 
 \par color (3-d vector, default:  {1., 1., 1.})
   The color of the mesh as red-green-blue values. Black is (0., 0., 0.)

File doc/examplemodel.lua

         r = { 0, 0 , 1. },
       },
       visuals = {
-				MeshA = {
-					name = "MeshA",
+				HipMesh = {
+					name = "HipMesh",
 					dimensions = { 0.25, 0.4, 0.25 },
 					color = { 0.8, 0.8, 0.2},
 					mesh_center = { 0, 0, 0.125 },
       name = "FrameB",
       parent = "FrameA",
       joint_frame = {
-        r = { 0, 0 , 1. },
-				E = { 
-					{1., 0., 0.},
-					{0., 0., -1.},
-					{0., 1., 0.}
+        r = { 0, 0 , 0.25 },
+				E = {
+					1., 0., 0.,
+					0., 1., 0.,
+					0., 0., 1.
 				}
       },
       visuals = {
-				MeshA = {
-					name = "MeshA",
-					dimensions = { 0.25, 0.4, 0.25 },
-					color = { 0.8, 0.8, 0.2},
-					mesh_center = { 0, 0, 0.125 },
+				TorsoMesh = {
+					name = "TorsoMesh",
+					dimensions = { 0.4, 0.6, 0.6 },
+					color = { 0.8, 0.8, 0.4},
+					mesh_center = { 0, 0, 0.35 },
 					src = "meshes/unit_cube.obj",
 				},
-				MeshB = {
-					name = "MeshB",
-					dimensions = { 0.3, 0.6, 0.7 },
-					color = { 0.8, 0.8, 0.4},
-					mesh_center = { 0, 0, 0.35 },
+				HeadMesh = {
+					name = "HeadMesh",
+					dimensions = { 0.4, 0.4, 0.4 },
+					color = { 0.1, 1.0, 0.2},
+					mesh_center = { 0, 0, 1.0 },
 					src = "meshes/unit_cube.obj",
 				},
       },

File logo/meshup_logo_square.svg

Old
Old image
New
New image

File models/samplemodel.json

-
-{
-	"configuration" : 
-	{
-		"axis_front" : [ 1.0, 0.0, 0.0 ],
-		"axis_right" : [ 0.0, 0.0, 1.0 ],
-		"axis_up" : [ 0.0, 1.0, 0.0 ],
-		"rotation_order" : [ 2, 1, 0 ]
-	},
-	"frames" : 
-	[
-		
-		{
-			"name" : "HIP",
-			"parent" : "BASE",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, 0.9, 0.0 ]
-		},
-		
-		{
-			"name" : "UPPERBODY",
-			"parent" : "HIP",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, 0.250, 0.0 ]
-		},
-		
-		{
-			"name" : "UPPERARM_L",
-			"parent" : "UPPERBODY",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, 0.650, -0.40 ]
-		},
-		
-		{
-			"name" : "LOWERARM_L",
-			"parent" : "UPPERARM_L",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, -0.450, 0.0 ]
-		},
-		
-		{
-			"name" : "UPPERARM_R",
-			"parent" : "UPPERBODY",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, 0.650, 0.40 ]
-		},
-		
-		{
-			"name" : "LOWERARM_R",
-			"parent" : "UPPERARM_R",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, -0.450, 0.0 ]
-		},
-		
-		{
-			"name" : "HEAD",
-			"parent" : "UPPERBODY",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, 0.70, 0.0 ]
-		},
-		
-		{
-			"name" : "UPPERLEG_L",
-			"parent" : "HIP",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, 0.0, -0.150 ]
-		},
-		
-		{
-			"name" : "LOWERLEG_L",
-			"parent" : "UPPERLEG_L",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, -0.450, 0.0 ]
-		},
-		
-		{
-			"name" : "UPPERLEG_R",
-			"parent" : "HIP",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, 0.0, 0.150 ]
-		},
-		
-		{
-			"name" : "LOWERLEG_R",
-			"parent" : "UPPERLEG_R",
-			"parent_rotation" : [ 0.0, 0.0, 0.0 ],
-			"parent_translation" : [ 0.0, -0.450, 0.0 ]
-		}
-	],
-	"segments" : 
-	[
-		
-		{
-			"color" : [ 0.80, 0.80, 0.20 ],
-			"dimensions" : [ 0.250, 0.250, 0.40 ],
-			"frame" : "HIP",
-			"mesh_center" : [ 0.0, 0.1250, 0.0 ],
-			"mesh_filename" : "meshes/unit_cube.obj",
-			"name" : "HipMesh1"
-		},
-		
-		{
-			"color" : [ 0.80, 0.80, 0.40 ],
-			"dimensions" : [ 0.30, 0.70, 0.60 ],
-			"frame" : "UPPERBODY",
-			"mesh_center" : [ 0.0, 0.350, 0.0 ],
-			"mesh_filename" : "meshes/unit_cube.obj",
-			"name" : "UpperBody"
-		},
-		
-		{
-			"color" : [ 0.10, 0.10, 0.80 ],
-			"dimensions" : [ 0.20, 0.450, 0.20 ],
-			"frame" : "UPPERARM_L",
-			"mesh_center" : [ 0.0, -0.2250, 0.0 ],
-			"mesh_filename" : "meshes/unit_cube.obj",
-			"name" : "UpperArm_L"
-		},
-		
-		{
-			"color" : [ 0.20, 0.20, 0.90 ],
-			"dimensions" : [ 0.20, 0.450, 0.20 ],
-			"frame" : "LOWERARM_L",
-			"mesh_center" : [ 0.0, -0.2250, 0.0 ],
-			"mesh_filename" : "meshes/unit_cube.obj",
-			"name" : "LowerArm_L"
-		},
-		
-		{
-			"color" : [ 0.80, 0.10, 0.10 ],
-			"dimensions" : [ 0.20, 0.450, 0.20 ],
-			"frame" : "UPPERARM_R",
-			"mesh_center" : [ 0.0, -0.2250, 0.0 ],
-			"mesh_filename" : "meshes/unit_cube.obj",
-			"name" : "UpperArm_R"
-		},
-		
-		{
-			"color" : [ 0.80, 0.20, 0.20 ],
-			"dimensions" : [ 0.20, 0.450, 0.20 ],
-			"frame" : "LOWERARM_R",
-			"mesh_center" : [ 0.0, -0.2250, 0.0 ],
-			"mesh_filename" : "meshes/unit_cube.obj",
-			"name" : "LowerArm_R"
-		},
-		
-		{
-			"color" : [ 0.10, 0.70, 0.10 ],
-			"dimensions" : [ 0.8, 0.850, 1. ],
-			"frame" : "HEAD",
-			"mesh_center" : [ 0.0, 0.2250, 0.0 ],
-			"mesh_filename" : "meshes/monkeyhead.obj",
-			"name" : "Joint"
-		},
-
-		{
-			"color" : [ 0.10, 0.70, 0.10 ],
-			"dimensions" : [ 0.40, 0.450, 0.40 ],
-			"frame" : "HEAD",
-			"mesh_center" : [ 0.0, 0.2250, 0.0 ],
-			"mesh_filename" : "meshes/monkeyhead.obj",
-			"name" : "Head"
-		},
-		
-		{
-			"color" : [ 0.10, 0.10, 0.80 ],
-			"dimensions" : [ 0.20, 0.450, 0.20 ],
-			"frame" : "UPPERLEG_L",
-			"mesh_center" : [ 0.0, -0.2250, 0.0 ],
-			"mesh_filename" : "meshes/unit_cube.obj",
-			"name" : "UpperLeg_L"
-		},
-		
-		{
-			"color" : [ 0.20, 0.20, 0.90 ],
-			"dimensions" : [ 0.20, 0.450, 0.20 ],
-			"frame" : "LOWERLEG_L",
-			"mesh_center" : [ 0.0, -0.2250, 0.0 ],
-			"mesh_filename" : "meshes/unit_cube.obj",
-			"name" : "LowerLeg_L"
-		},
-		
-		{
-			"color" : [ 0.80, 0.10, 0.10 ],
-			"dimensions" : [ 0.20, 0.450, 0.20 ],
-			"frame" : "UPPERLEG_R",
-			"mesh_center" : [ 0.0, -0.2250, 0.0 ],
-			"mesh_filename" : "meshes/unit_cube.obj",
-			"name" : "UpperLeg_R"
-		},
-		
-		{
-			"color" : [ 0.90, 0.20, 0.20 ],
-			"dimensions" : [ 0.20, 0.450, 0.20 ],
-			"frame" : "LOWERLEG_R",
-			"mesh_center" : [ 0.0, -0.2250, 0.0 ],
-			"mesh_filename" : "meshes/unit_cube.obj",
-			"name" : "LowerLeg_R"
-		}
-	]
-}
-

File src/Animation.cc

 		Vector3f scale(1.0f,1.0f,1.0f) ;
 
 		//only scale, if the dimensions are valid, i.e. are set in json-File
-		if (seg_iter->dimensions[0] != 0.f) {
+		if (seg_iter->dimensions.squaredNorm() > 1.0e-4) {
 			scale = Vector3f(
 					fabs(seg_iter->dimensions[0]) / bbox_size[0],
 					fabs(seg_iter->dimensions[1]) / bbox_size[1],

File src/MeshupModel.cc

 		cerr << "Invalid array size for 3d vector variable '" << path << "'." << endl;
 		abort();
 	}
-
+	
 	for (unsigned int i = 0; i < 3; i++) {
 		result[i] = static_cast<float>(array[i]);
 	}
 
 	std::vector<double> array = get_array (L, path, -1);
 	if (array.size() != 9) {
-		cerr << "Invalid array size for 3d matrix variable '" << path << "'." << endl;
+		cerr << "Invalid array size for 3d matrix variable '" << path << "'. Expected 9 but was " << array.size() << endl;
 		abort();
 	}