How do I load a 360 image viewer using forge viewer. One approach I tried was by creating a sphere with image as texture and add it to the overlay scene. Using this, I was able to load a 360 image but I'm getting rendering issues (in some specific views sphere is getting culled).
Check out the skybox sample here and see that fits the bill for you ...
Related
My current use case is to align a 2d image to a 3d model inside the forge viewer allowing zoom as well as panning functionalities. I have tried the following implementations -
Adding the 2d image as an overlay scene on the forge viewer but the problem there is that I can't position the model on the image precisely even though i have tried translating, rotating and scaling the model programatically.
Loading two different viewers on top of each other and then using viewer.getState() and viewer.restoreState() to sync the state between the two viewers on Autodesk.Viewing.CAMERA_CHANGE_EVENT.
Placing the image inside the HTML beneath the forge viewer and then disabling the pointer events on the viewer and using Javascript to zoom both the viewer and the image in sync. But the problem there is that the measure tool doesn't seem to work right.
What am i missing?
I assume that you simply want to insert a 2D raster image into the viewer scene. That can certainly be done using the 1st approach you suggested. Use an overlay scene or the SceneBuilder extension to add a custom three.js mesh into the scene, and then apply your image as a texture to the mesh.
Regarding the placement of the mesh in the viewer scene, that really depends on your use case and the type of models you're working with. For example, if you wanted to place the image under the 3D model (perhaps the picture contains some satellite imagery), you could find the bounding box of the model using the viewer APIs (viewer.model.getBoundingBox()), and place the three.js object with your image at the bottom side of it.
I want to show X,Y,Z axes in forge viewer at the bottom-left corner like Navisworks. I can create the axes lines (described here) in a certain position of the viewer. But, as expected, whenever I navigate to somewhere the axes also moves. I want it to be placed at the bottom-left corner every time and syncing with the viewer X,Y,Z axes. The Navisworks axes in HUD is like below -
Please share some good idea!
Forge Viewer doesn't offer this feature out-of-the-box but it should be pretty straightforward to implement something similar yourself.
I'd recommend using the approach used by the viewer's "view cube" (in the top-right corner). That cube is actually rendered in its own <canvas> element, and overlaid on top of the viewer canvas. You could create your own <canvas> element in the bottom-right corner, use standard three.js (specifically version 71 that's included in Forge Viewer) to render your axes there, and update their orientation based on the viewer's Autodesk.Viewing.CAMERA_CHANGE_EVENT.
Trying to set the anti-aliasing property in autodesk forge (for 2D model/floor plan)
I have adding custom text geometry in my forge viewer but strigling to imrove it's quality.
Tried setQualityLevel (viewer3d.setQualityLevel(true, true)) to set the anti-aliasing on but it didn't improved the qulity/ or anti-aliasing does not seems to be working?
Attaching both images below.
with anti-aliasingoff
and anti-aliasing on
Thanks
I have checked the implementation of Forge viewer and captured some more screenshots to explain the problem again.This time I am capturing geometry created by the autodesk forge measurement tool so that we can target the real problem.
In Autodesk 3d viewer we have this option to enable disable the anti-aliasing
enter image description here
if we set it to on the result is below one.
enter image description here
We can see edges are still jagged but not as compared to what results if we set it to off.
Following is the result of anti-aliasing
enter image description here
Observe the red line and difference that anti-aliasing flag makes in the overall quality of the rendered data.
We need to solve the same problem in 2D version of viewer but unfortunately the option to toggle anti-aliasing is not present in 2D forge viewer.I know that the implementation of anti-aliasing present in Autodesk Forge is FXAA and not sure if there are any limitations for 2d in it? if not then can you please let us know if we can expect this future version of Autodesk forge ? Please let us know
Please note that according to the API reference the antialiasing is:
Not applicable to 2D.
That is most likely why the settings have no effect on your 2D drawing.
For some of our Revit models, in Forge viewer, 2D views are display blurry, no element can be selected and the Measure extension does not work on elements and only works on the dimensions and the titleblock.
Like this example:
here and here
But it should be like this
I have tested it with our viewer, A360 viewer and Autodesk Forge Tools vscode extension.
This is because 2D drawings or PDFs can contain both vector graphics and raster graphics (this article explains the difference between the two). The measure extension needs vector graphics in order to work properly.
Thanks to Petr Broz and his hint, by changing the Model Display Style in Revit side to Hidden Line instead of Shaded the problem was solved.
Like this.
Update:
The Shadows in Graphic Display Options, also should be unchecked.
I want to add hotspot sphere to a 3D .nwd model which has to be viewed in Autodesk Forge Viewer. Please suggest how hotspot can be added to .nwd naviseworks file.
There are a couple of ways to add hotspots to a model in Forge Viewer:
by adding custom "point clouds" into the scene: https://forge.autodesk.com/blog/3d-markup-icons-and-info-card
by adding custom 3D geometry: https://forge.autodesk.com/en/docs/viewer/v7/developers_guide/advanced_options/custom-geometry/
by overlaying the 3D viewport with HTML elements; the Forge Digital Twin sample code shows how you can compute 2D positions from Forge model coordinates, specifically in the IssueExtension