[[user_manual:Mesh2Flash|{{user_manual:flag_english.gif|Switch to English}}]] [[manuale_utente:Mesh2Flash|{{user_manual:flag_italian.gif|Switch to Italian}}]] ====== DAVID Mesh2Flash ====== ===== 3D Internet Presentation for Free! ===== Mesh2Flash - developed by DAVID Vision Systems GmbH - is a free Flash program that is able to show 3D meshes (obj or dae) online with or without texture. It can be part of any web page and allows the viewer to freely rotate and zoom the 3D view by mouse. Mesh2Flash really renders the object live, instead of showing just a few fixed shots like many other "3D" viewers do. It can directly load the OBJ or DAE files, which are common 3D file formats - with or without texture. Only Adobe Flash Player is required, which has a diffusion rate of >98%. So if you want to present your 3D models on the Internet, e.g. in your online shop or a forum, Mesh2Flash is the right tool for you! \\ \\ (rotate with left mouse button!) ===== User Interaction ===== The user can rotate the view by holding the left mouse button and moving the mouse left-right (yawing) or up-down (pitching). Also the mouse wheel can be used for zooming in/out. There are some keyboard commands, too: * **Arrow keys**: Rotate view * **+**/**-**: Zoom in/out * **Z**/**z**: Zoom in/out * **f**/**F**: Decrease/increase camera focal length * **s**: Start/stop continuous rotation * **a**,**r**: Reset camera * **q**,**e**: Roll camera ===== How to Prepare Your 3D Data ==== Since Flash is rather slow in parsing files and 3D rendering, Mesh2Flash should only be used with //simple// meshes (only a few thousand triangles). A nice texture can make the mesh look great. **Some hints:** * If you have DAVID Professional, you can use David 2.4.4 or higher - there is a "Reduce Mesh Density" option in the right-click menu of DAVID-Shapefusion. It will reduce vertex density to the percentage you select. * Although it is possible to repeat the mesh reduction several times, it is better to reduce a mesh only one time. E.g. instead of reducing 4 times to 32%, reduce to 1% in one step. * This function has no undo. Use it on a saved scan and load again to undo. ===== How to Use Mesh2Flash to Show Your 3D Data ===== You have to include ''%%Mesh2Flash.swf%%'' in your document (web page, wiki page, forum post) and give it some parameters, mainly the ''file'' parameter giving the URL of your mesh file. Flash's security policy requires that Mesh2Flash.swf and the mesh files are on the same server/domain! So if your mesh files are not located on a ''david-laserscanner.com'' page but on some other server, you will have to [[http://www.david-laserscanner.com/?section=Downloads|download]] and install Mesh2Flash there. **General hints** * All syntaxes below seem to contain **double code**, namely the ''data'' and ''param value'' strings are equal. Unfortunately, this is necessary. Some browsers require the ''data'' parameter, others require the ''param value'' parameter. Please use both. * The blue texts contain the URL of the 3D data file. You have to adjust them to the real address of your file. This address can be given as a relative or absolute path. However it must be on the same domain as ''Mesh2Flash.swf''. * The red parts: If you are using Mesh2Flash on your own server, not on the DAVID domain, you will have to adjust the red addresses to the correct URL of Mesh2Flash on your server. * The **black** parts of the syntax are always the same, just copy&paste them. Of course you can change the ''width'' and ''height'' values, their ratio should be around 4:3. \\ **Using Mesh2Flash for meshes located on david-laserscanner.com (Wiki or Forum)** * See the information about Wiki or Forum syntax below. You will only have to adjust the blue parts. \\ **Using Mesh2Flash for meshes outside david-laserscanner.com** * Download Mesh2Flash [[http://www.david-laserscanner.com/?section=Downloads|from here]]. * Copy both files from the .zip download (''Mesh2Flash.swf'' and ''mesh2flash_overlay.png'') next to each other on the same webserver which also contains your 3D data. * Then use the syntax given below, adjusting the red and blue sections. ===== HTML Syntax ===== Use the following syntax in your html file to show a 3D mesh on your website. Of course replace the red and blue parts with the correct URLs. Both have to be located on the same server!
<object data="http://<some.server>/Mesh2Flash.swf?file=myMesh.obj" type="application/x-shockwave-flash" width="800" height="600">
     <param name="movie" value="http://<some.server>/Mesh2Flash.swf?file=myMesh.obj">
</object>
''myMesh.obj'' is the absolute or relative path to your mesh file (obj or dae). Adjust the ''width'' and ''height'' values if you wish. ===== Wiki Syntax (Dokuwiki) ===== === For a Wiki on your own server ===
<html>
     <object data="http://<some.server>/Mesh2Flash.swf?file=myMesh.obj" type="application/x-shockwave-flash" width="800" height="600">
          <param name="movie" value="http://<some.server>/Mesh2Flash.swf?file=myMesh.obj">
     </object>
</html>
=== For the DAVID Wiki === If you want to show a mesh file which you have uploaded in the Wiki's Media Files (e.g. in the folder ''your_name'' under ''user_page''), use a Wiki code similiar to this:
<html>
     <object data="http://www.david-laserscanner.com/freeware/Mesh2Flash/Mesh2Flash.swf?file=/wiki/_media/user_page/your_name/your_mesh_file.obj" type="application/x-shockwave-flash" width="800" height="600">
          <param name="movie" value="http://www.david-laserscanner.com/freeware/Mesh2Flash/Mesh2Flash.swf?file=/wiki/_media/user_page/your_name/your_mesh_file.obj">
     </object>
</html>
===== Forum Syntax (phpBB 3) ===== === For a Forum on your own server === Use the following code in your forum post:
[flash=800,600]http://<some.server>/Mesh2Flash.swf?file=myMesh.obj[/flash]
=== For the DAVID Forum === Use the following code in your forum post:
[flash=800,600]http://www.david-laserscanner.com/freeware/Mesh2Flash/Mesh2Flash.swf?file=myMesh.obj[/flash]
=== Attaching an OBJ file to a post and showing it in Mesh2Flash === If you want to attach a mesh file to your post and show it inline, the question will be: What is the URL of my attachment? Use the following way to find it (OBJ only!): - Write your post and attach the OBJ file (this extension must be permitted by forum admin) - //optional: attach the texture image file// - Click "Preview" - Look at the preview, the attached OBJ file is visible as a link. You can see the exact link by holding your mouse pointer over it or right-clicking it - this depends on the browser you are using. The link will be similar to this:
http://www.theserver.com/forum/download/file.php?id=2136
This id number is what were are interested in. It is different each time. - Place the code above somewhere in your post, using that link as the ''file'' parameter for Mesh2Flash, but **replace the question mark ''?'' in the link by the number sign ''#''** (the ''?'' directly behind ''Mesh2Flash.swf'' is not to be replaced!) - //optional: use the link to the texture image attachment as the ''texFile'' parameter. Again, replace the question mark ''?'' in the link by the number sign ''#''.// \\ **Example without texture:** (Note where the ? has been replaced by a #)
[flash=800,600]http://www.david-laserscanner.com/freeware/Mesh2Flash/Mesh2Flash.swf?file=http://www.david-laserscanner.com/forum/download/file.php#id=2136[/flash]
\\ **Example with texture:** (Note that two ? have been replaced by #)
[flash=800,600]http://www.david-laserscanner.com/freeware/Mesh2Flash/Mesh2Flash.swf?file=http://www.david-laserscanner.com/forum/download/file.php#id=2136&texFile=http://www.david-laserscanner.com/forum/download/file.php#id=4242[/flash]
\\ Of course it is possible to link between Forum and Wiki as long as they are located one the same domain. ===== Parameters ===== Beside the parameter "file", there are some **optional** parameters you can define. They have to be separated by ''&''. Their order is arbitrary, but upper/lower case is relevant! * **pitch**: Initial pitch of the view in degree (default: 0). Use e.g. 30 to view the object slightly from above. * **yaw**: Initial yaw of the view in degree (default: -45). Yawing is rotating the object around the vertical axis. * **rotate**: Continuous rotation (yawing) of the object around the up axis in degree per (1/30) second (default: 0=off). * **mouseWheelFactor**: How fast the mouse wheel zooms in and out. Negative values invert the direction. 0 mean no zooming. (default: 5). * **focalLength** Initial focal length of the camera (default: 500). * **backgroundColor** Background color of the Flash viewport hexadecimal between 0x000000 and 0xFFFFFF as 0xRRGGBB (Red, Green, Blue). Default: 0xFFFFFF = white. * **lightColor** (only for untextured OBJ meshes) Color of the light source (default: 0xFFFFFF). * **ambientColor** (only for untextured OBJ meshes) Color of the ambient light (default: 0x403830). * **specular** (only for untextured OBJ meshes) Surface specularity (default: 30). * **shaderMode** (only for untextured OBJ meshes) 0=Phong Shader, 1=Flat Shader (default: 0). * **texFile** (only for OBJ files) URL of the texture image to be used if there is no mtl file Example: ...Mesh2Flash.swf?file=http://www.david-laserscanner.com/freeware/Mesh2Flash/cow.dae&pitch=30&yaw=90&rotate=2 ===== Texture ===== ==== Texture in OBJ ==== === With MTL File === Usually, beside the .obj file, there is a material file (.mtl) in the same folder with the same name. For example, greatMesh.obj and greatMesh.mtl. In that mtl file, the texture filename must be given. E.g. map_Kd myMesh.png Of course, when you save a textured scan with DAVID, these files will be create accordingly. === Without MTL File === If there is no such mtl file, or if you are using an OBJ posted as a Forum attachment, you can define the location of the texture file separately by the **texFile** parameter (see above).