Skip to content
Shane Saxon edited this page Feb 8, 2021 · 63 revisions

3D Models (3DS, OBJ, STL, PLY, COLLADA...) are IMPORTED using the ASSIMP library:

http://assimp.sourceforge.net/main_features_formats.html

Models placed in the 'usr/global/models' folder are added to the geometry_id ('O' key) list at startup. You can also use the File Dialog ('L' key) to load models and auto-assign to the current node(s). At this time we support basic geometry mesh hierarchies and a single texture map per models file.

np_models table fields:

  • np_models_id row id is referenced by parent_id.
  • parent_id specifies the models_id object hierarchy, 0 for root objects.
  • geometry_id per object, starts at 1001 (lower id's are reserved for primitives).
  • topo_id defines topology and (if missing vertex normals) type of texture coords.
  • texture_id links texture map files using the np_texture table.
  • center XYZ is auto-calculated using a bounding box.
  • rotate XYZ is manually set in the np_models table using KML Model Orientation.
  • scale XYZ is auto-normalized to fit into a 2 unit cube (-1 to 1).
  • smooth Smoothing angle - ***perhaps do this globally with np_models_ai_pf()
  • ai_node_id needed if building hyperglyph trees with themodels scene nodes.
    • ai_mesh_id perhaps redundant to ainode_id (unless we split each node mesh into a geo)
  • object the aiNode name (object) name in the models scene file.

Attributes that are global to the models scene (set by the scene root (parent) object, children are ignored). saving the dataset will export the models as a binary *.antz3d (our mime type).

  • np_ai_pflags aiImport property flags (uint32)
  • np_models_flags our import flags filter, eg: "MT...." will load (only) meshes and textures.
  • file name.
  • path location.

*Note that global default settings for models are set in the np_globals table, but the flags can also be overwritten by np_models table on a per node basis:

  • np_models_flags antz models import flags eg, "H..." Converts the models scene hierarchy to a forest of hyperglyphs OR "EH" exports .antz3d binary cache file (during import).
  • np_models_ai_pi Calls aiSetProp..Int(), note that the format is ""AI_PROPERTY_AS_STRING",42"
  • np_models_ai_pf Calls aiSetProp..Float(), note that the format is ""AI_PROPERTY_AS_STRING",42.0"
  • np_models_ai_ps Calls aiSetProp..Str(), note that the format is ""AI_PROPERTY_AS_STRING","Forty Two""

Tip: You can re-generate the (bounding box) scale and (geometric) center by setting the x/y/z scale to zero (in np_models table). Note that at draw time, grid objects are scaled to fit the grid extents (and it is assumed the geometry is normalized).

Texture Loading File Search Order:

  • First it tries the path specified in the 3D models file.
  • Then it checks if the texture is in the same folder as the models file.
  • Lastly, it searches the default 'usr/global/images' texture folder.

See np_texture table for image processing: crop, scale, rotate....

Future planned import flags are "GTKSNMPGLCAT" for: Geometry, Textures, Kinematics, Shading, Nurbs, Morphing, Particles, Geolocation, Lights, Cameras, (track) Animation and Tags, Bind (textures), Use (materials), Hyperglyphs (hierarchy from models scene), Lines, Points (default is off, need ON for point cloud data). At this time, we only import geometry and its texture map, so "GTXXXXXXXXXX" are the current default flags.

Future feature to EXPORT entire scene to a COLLADA file. Initial version will transcode each node to a simple mesh object (by converting mesh verti from model space to world space to create a flattened world coord scene.) Later, we plan to map our topo hierarchies to COLLADA kinematics tree structures with closed (link) loops. Eventually, add track animation, morphing, nurbs, particles, shaders, geolocation, tags, etc.... COLLADA files can be edited with 3D modeling programs or loaded into realtime GIS systems (such as GeoFusion) or viewed in a standard web browser using WebGL.


--- RESOURCES ---

You can search the web for free 3D models, there are lots of paid and free models available.

Clone this wiki locally