main content

import fbx models from paint 3d into a virtual world -凯发k8网页登录

this example shows a workflow for prototyping 3d models in microsoft's paint 3d and using them in the simulink® 3d animation™ editor and viewer. this example assumes that you are working on a microsoft® windows® platform.

the example uses a variation of the uav competition example model, whose simulation is displayed in the 3d animation viewer.

create 3d model using paint 3d

in this example, we will be modifying the virtual world to add a different drone exported from paint 3d.

in paint 3d, you can create your own model using shapes and objects in the 3d shapes pane. this example, however, uses one of the drones from microsoft's remix 3d repository.

create your own model or import it into the paint 3d canvas. to import a model, select 3d library from the paint 3d toolstrip to view microsoft and user-contributed models to the remix 3d repository.

when you're ready to export the model, open the paint 3d menu by selecting menu in the toolbar and select save as. choose the 3d model option in the save as copy section. in the windows save as dialog, select fbx as the desired file type for your model.

import fbx model into virtual world

the uav_fbx_import uses the attached uav_scene_drone_example.wrl world file to define the structure of the virtual world. open the virtual world file in the 3d world editor.

select nodes > import from > fbx file to import the saved 3d model into the node tree as a child of the uav_col_transf (transform) node.

to quickly find the inserted body in the virtual world, right-click the name of the newly inserted node and select view node.

you may find that the imported node is not in the right place or the right size. update the translation, rotation, and scale properties of the imported node to place the drone on the starting mat and within the bounds of the collision box defined by uav_col_shape. save the modified virtual world.

display simulation using imported model

open uav_fbx_import and add a new vr sink block. configure the block settings to use the included uav_scene_world_example.wrl virtual world. select the rotation and translation properties of the imported_fbx_model and nodes.

connect the outputs of the uav navigation & tracing block to the ports labeled uav.rotation and uav.translation. the uav (transform) node is a direct ancestor of the imported model in the node hierarchy of the virtual world. therefore, rotation and translation operations applied to the uav node, affect the bounding box uav_col_shape, the uav model imported_fbx_model, and the primitive pick sensors that detect collision and landing of the uav.

simulate the model using the predefined trajectory or manually, using a spacemouse by switching the spacemouse/predefined navigation switch block.

see also

used with permission from microsoft.

凯发官网入口首页 copyright 2019 the mathworks, inc.

网站地图