HTML5 / JavaScript / WebGL viewer of KMZ / KML 3D OBJECTS? - html

Is there any HTML5/javascript/webgl viewer of KMZ KML 3D OBJECTS ?
i would like to use WEBGL technology to render kmz/kml 3d object (building) created in sketchup and uploaded to google warehouse.
Target is to use browser technologies instead of flash/java to render 3D product overview on white backgrdound with only horizontal rotation.
Thank you for any suggestions

Three.js has a ColladaLoader. SketchUp can export to Collada, and that's what KMZ files use. It's the .dae file in the KMZ.

I built a small library called kamikmz exactly for this purpose. The problem with loading a Collada model straight up is that you need to have the images referenced as textures available on the correct path as well. To overcome this issue I use the jszip library to unzip the kmz file right in the browser and the pass it to threejs.
Right now the library is still in development and has some performance issues when it comes to loading large models, however it works fine for most cases.

Related

Is Gltf2 Animation supported in Forge Viewer?

I've got a Gltf2 model which contains an animation (I checked on sandbox.babylonjs.com and I see the animation, so the gltf is ok). Is it possible to view the animation on the Viewer? I translated to SVF2 and loaded the model, but there is nothing referred to the animation...
Is there something more I should include in the translation or some option to use when creating the viewer?
Thanks for your help
glTF animations are not supported, no matter whether you're loading the glTF file into the viewer directly (https://forge.autodesk.com/blog/gltf-20-support-forge-viewer), or converting it to SVF or SVF2 first, as there hasn't been a demand for this feature.
As a potential workaround, you could try loading the glTF file using the standard three.js loader (which I'm guessing does support animations?) and place it inside a viewer overlay.

Extract vector images from Revit file

I was wondering if it's possible to extract Vector images from 2d views of revit files from forge api. I've used the following endpoint to achieve thumbnail of the views, but the thumbnails are very small (400 x 400)
https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-thumbnail-GET/
Is there a way I can extract high resolution image, (preferably in vector formate that can be zoomed in or out) from a 2d View ?
Here's an example that I've tried:
https://jsfiddle.net/uLnvwyLa/
Use the Viewer screenshot API and run a headless browser, no UI interaction needed and can run server-side. This will definitely produce the highest quality thumbnails that you can possibly obtain. Here are links that may be helpful:
https://github.com/GoogleChrome/puppeteer
http://adndevblog.typepad.com/cloud_and_mobile/2015/05/screenshot-extension-manager-for-the-viewer.html
See viewer.getScreenshot method:
this.viewer.getScreenShot(
width, height, (blob) => {
Talked with Autodesk support Philippe
For the 2d views in Revit, the short answer is that Forge does not support translating 2d views to vector images or high resolution images as you wanted.
But here is some additional information in case this is also workable for you. You can use Model Derivative API to translate the 2d views into f2d format, just make sure to set the output.formats.views to both "2d" and "3d". You can not open this f2d file directly, but only through the Viewer3D library to load it into browser just as same as svf file, check the doc and tutorials here, the result looks as follow, and you can use http://lmv.ninja.autodesk.com to play with a 2d sheet and see how it works in browser.

How do you convert glTF to Cesium 3D Tiles?

There doesn't appear to be any clear way to do this, or existing tools.
I have edited the 3D-Tiles-Tools provided by cesiumjs to convert the gltf to b3dm.
For your reference, here is the link https://github.com/Jennyshining/3d-tiles-tools.git
In the repository, samples-generator/lib/myGenerator.js is the entry.
createGltf is the tool to create gltf, createB3dm and createTilesetJsonSingle are used to create 3d tiles.

Adding 3D model KMZ with Google Maps API: is it possible?

I'm wondering if it's possible to add a 3D model made in Sketchup, exported o KMZ format, to a Google Map, with the Google Maps API. I was able to add KMZ layers that contained simple data as landmarks and such, but when I try to load the 3D model KMZ, the map just shows a default house file icon.
The test map can be accessed here: http://thebob.com.br/maptest/kmz_test.html
The KMZ file is hosted here: https://sites.google.com/site/dmgckmlfiles/kml-files/Bulk_carrier_1509.kmz
At this point I'm just guessing it's not possible to add 3D models like this into Google Maps (as the exact same thing happens if I import the file through My Maps), but I want to make sure of that before giving up.
Thanks in advance for any info!
Well if you are pertaining in Google JavaScript API, Yes this API does support the KMZ as you can see in this link about Supported KML elements. But the 3D object is not.
Also, according to this SO question, that 3D is not yet features in Javascript API. Closest things to this are Styled Maps. Only the Android implementations are available as of now.
But I found this tutorial that can help you if you still want 3D objects.

Enabling two sided material for 3D mesh files in Cocos2D-X

I am developing a 3D game with Cocos2D-X. I have converted .fbx mesh file into .c3b and .c3t file format using fbx-conv tool. I have imported these files into 3D scene and they are displayed properly along with the materials. I want these mesh files to be two sided. I did research but could not find helpful resources. Also, there is no Material Editor (present in UE4 and Unity3D) available in Cocos2D-X through which I can enable two sided property. How should I implement two sided mesh files in Cocos2D-X?
I’d appreciate any suggestions on this issue. Thank you in advance.