span8
span4
span8
span4
This example converts an FBX model into KML for viewing in Google Earth.We will be georeferencing a 3D Duplex building and placing it on the soccer field of Unwin Park in Surrey,BC.The workspace preserves the original textures in the FBX model.We will also be customizing KML properties such as setting a pop-up balloon in Google Earth when the model is selected.
The source data is an FBX model of a duplex originally from buildingSmart Alliance'sCommon Building Information Model Files.Download the template workspace or read in the duplex_A.fbx dataset using the FBX reader in FME.
The FBX source duplex model viewed in the FME Inspector.
The ideal geometry to write out to KML is a single mesh.We will use theTriangulatorto first break down the FBX geometry into a mesh,and then theMeshMergerto unify the triangular units into a single output mesh.The Meshmerger ensures that we are storing the geometry in the most efficient way,and also makes the translation significantly faster.Without this step,the geometry output cannot be drawn in Google Earth.
Use theKMLPropertySetterto customize the balloon pop-up in the output KML.Here,we will specify a name,description,and file summary for the model.Notice that the Content will be visible in the balloon pop-up while the Summary is only visible in the Google Earth toolbar ‘Places'.For these parameters I have used:
While these are the parameters that I have used,feel free to get creative and use your own text.
We will use theLocalCoordinateSysemSetter to set the origin location of our model on Earth,which we have chosen as Unwin Park in Surrey,BC.The point 0,0 on our FBX model is the corner of the building on the ground,and this is the point that will be georeferenced.
Normally,to write to KML,data must always be reprojected to the lat/long coordinate system LL-WGS84.Since the FBX model has no current coordinate system,we will set the origin coordinate system to LL-WGS84,which is the FME equivalent to the WGS84 datum,the same one that supports Google Earth and Google Maps.Our source data is tagged with the coordinate system information as it goes through this transformer.
The coordinates for Unwin Park have been collected from Google Maps,and are in latitude and longitude.
Utilize the KML writer by running the translation.If you are creating your workspace from scratch,remember to set Workspace parameters to Continue Translation in "Rejected Feature Handling".You can find this by going through Workspace Parameters in your Navigator,and selecting Translation.
Due to a known issue,PR# 52475,you may need to first read in a SketchUp file using the Trimble SketchUp Reader and run the translation to convert it to KML,before swapping out the reader for the FBX reader.This will prime your workspace to retain the FBX textures in your KML output.Please try this workaround if your output KML buildings appear all gray.You can use this SketchUp file:duplex-A-skp.zip
Open up your output in Google Earth.Congratulations!You have georeferenced your FBX model and preserved its original textures,adding on some style by customizing the pop-up balloon.Below,you can see the duplex model placed successfully in Unwin Park in Surrey,BC.
The output KML properly georeferenced in Unwin Park with a balloon pop-up description.
A closer look at the output model in Google Earth showing the original textures from the FBX model.
© 2019 亚搏在线Safe Software Inc |Legal