cesium load gltf, not in the right position
I'm trying to load a model of house, by cesium. I have already set the position of the model by specified the matrix of the model, but the model is not in the position where I put it. I found the model origin is not in or near the model itself .
Someone suggested, modifying the gltf file, to make sure the origin is near or in the center of model should work, but how can this be done through programming? I don't want to edit thousand gltf models.
Maybe some with this links will help:
https://cesium.com/docs/on-premise/tilers/models/
https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Model
By the way, how bad is the wrong position? Are you sure that didn't inverted latitude and longitude?
Related
With Openlayers, I'm visualizing GIS rasters(DEM, Orthomosaic) in GeoTIFF format(using WebGLTileLayer) on top of OSM(as WebGLTile layer) in OL Map.
The issue I'm having is, the GIS rasters which have georeferencing, are not positioned in its correct geographic position on the OSM base map. The DEM seems to appear in nowhere, around gulf areas or on top of water bodies.
I've created OSM layer with it's default projection & I'm setting view after raster source is loaded, using source.getView()
I referred to Raster reprojection examples in the Openlayers website, but wasnt able to solve this.
Does anyone have an idea on how to resolve this?
As Mike had suggested in the comments, this issue was happening since even though the projection name was identified from the raster - Eg: "EPSG:3237", the Openlayers library doesnt have the projection definition(what it actually means), so now I'm fetching proj definition from epsg.io & registering in proj4 defs. Now it works perfectly!
Thanks Mike.
I am looking for a way to create a geojson file from the distributions of the health sectors in my region which are different than any political division readily available on osm:
There are fantastic tools such as geojson.io to draw custom polygons but because of the complexity I would need a tool that allows me to overlay an image to use it as a template or that does this automatically. If this makes a difference, I may be able to extract the silhouette with any computer vision library but my problem of how to get from an image or shape to geojson still remains.
Which is the fastest way to approach this?
You can do this using QGIS with manual georeferencing in order to assign real-world coordinates to an image without geo-information. This is done by clicking points on a map that correspond to points on your image. Then once georeferenced you can export the file as a geojson.
Another solution is to find a shape file (maybe this is correct) and simply convert the .shp into a geojson.
Is there a method from Autodesk Forge to find out the location of each point from the corner of the building like the picture I attached?
In the context of Forge Model Derivative & Viewer, the geometries have been translated to mesh (triangles). It does not contain the information of face/edge, which means it does not tell which is corner of the shape. you may have to calculate which is the furthest vertex. This is a blog about how to get vertex
https://forge.autodesk.com/blog/show-mesh-triangles-data-hittest
I am finding a way to pass my coordinates from 2D to 3D model.
I am stuck with an issue where I have Line/Spine which has Start and End Point.
I would like to know how can I get the Start and End point of that line which is been show in my model.
also is there any way to replace that line with my custom line using geometry (i know how to do this in 3D viewer but not sure about 2d view)
I have tried different approaches but seems like nothing is working for me
here is the reference which I was trying to follow
Link
and below is the Line/Path, what I am looking for is geometry of this line or the path of this line so that I can extract vector3 point from where the line is traveling
If you are interested in parsing the contents of a 2D model in Forge Viewer, that is also possible, using a helper class called Autodesk.Viewing.Private.VertexBufferReader. It can iterate through all the "primitives" in a 2D drawing (lines, circular arcs, elliptical arcs, etc.) and call your custom code for each one of them. Here's a blog post that explains the usage of this class: https://forge.autodesk.com/blog/working-2d-and-3d-scenes-and-geometry-forge-viewer.
I would like to display some reference lines in the viewer that are not shown by default when a drawing is uploaded to Forge.
I know the exact end points of the lines as they were defined in the model, however, it seems that the model in the viewer is translated so that 0,0 is in the center of the bounds.
Is there a way to get the transformation matrix that was applied to the model, so I can align the coordinates of my reference lines with the coordinates of the model in the viewer?
Use viewer.model.getData().globalOffset