Commit Graph

13 Commits

Author SHA1 Message Date
Bengt Gustafsson
4c6e11a146 untabified 2016-12-29 18:38:13 +01:00
Bengt Gustafsson
ff1e14bf44 Changed handling of collada meshes with multiple instances so that the prim.Asset values are the same in all Prims, while the difference in rotation, position and scale deduced from the Collada instance transform matrix are stored in the Position, Scale and Rotation members of each prim, properly adjusted for the rescaling and offseting done to the mesh vertices to fit into the unit cube of SL meshes.
This fixes bugs related to the case that several instances of the same mesh but with different rotation in their transformation matrix was present in the Collada file, which previously caused distorted objects except for those having the same rotation as the first instance.

A caveat is that now, as the incoming transform matrix is not used when creating the vertices and as the ModelPrim only stores rotation, scale and translation files which have transforms containing shear etc. not encodable by these three vectors will produce erroneous output even if there is only one instance of each mesh.

At the same time save some time and space during conversion by sharing the Positions and Faces members of all prims and not redoing the AddPositions and AddFacesFromPolyList calls for each instace (as results are identical). Applications that change the vertices or faces in situ in individual prim instances may suffer.
2016-12-29 18:29:22 +01:00
Latif Khalifa
2654337297 Change copyright year a bit ahead of time 2015-11-06 19:40:28 +01:00
Latif Khalifa
f47dcb5abd Change domain name to openmetaverse.co 2015-11-06 19:00:05 +01:00
Diva Canto
00e5078bee One final improvement to instanced geometry in the libomv model: create only the necessary assets. 2014-12-14 19:32:08 -08:00
Diva Canto
e31df72ef8 Additional improvements to the bulk mesh upload: support more Collada! Specifically, this now supports something that the LL viewer doesn't: the ability for instances of geometries to reuse geometries specifications.
Imagine a track with many poles, each pole being the same geometry; the LL viewer requires a geometry element for every single pole! This patch makes libomv able to parse Collada files where instances reuse geometries, allowing for much more concise Collada files.
2014-12-14 15:49:20 -08:00
Diva Canto
66a2e4d750 Removed an unnecessary import. 2014-12-13 23:15:32 -08:00
Diva Canto
9e6b52edee A couple of improvements to the bulk collada importer:
(1) handle hierarchical nodes in the visual scene
(2) handle the <triangle> element of geometries. This was done the lazy way: convert <triangles> to <polylist> and call the function that was already there for handling <polylist>
2014-12-13 23:10:38 -08:00
Latif Khalifa
f2d2d6b29d Mesh upload: moved collada library into it's own namespace 2014-06-27 22:48:28 +02:00
Latif Khalifa
9043124aaf Mesh upload: request inventory fetching of the newly created item 2014-06-27 15:41:47 +02:00
Latif Khalifa
9262308529 Mesh upload: added image upload along with the models 2014-06-27 15:08:24 +02:00
Latif Khalifa
0a323d39a9 Added support for quads in meshes, fixed normals 2014-06-27 11:32:29 +02:00
Latif Khalifa
2e306450c7 Collada parser and model uploader. Work in progress.
Sample code:

            var parser = new OpenMetaverse.ImportExport.ColladaLoader();
            var prims = parser.Load(o.FileName);
            if (prims != null && prims.Count > 0)
            {
                var uploader = new OpenMetaverse.ImportExport.ModelUploader(client, prims);
                uploader.PrepareUpload();
            }

Note that PrepareUpload performs the upload as well in this initial stage.

TODO:
* Image upload
* Support for quads in addition to triangles
2014-06-27 08:21:29 +02:00