Data table to spawn cylinders in specific coordinates

Hi all,

I am in the process of creating a digital twin of a city and need UE to overlay information. Currently, I am using Cesium and OSM Buildings to create the standard 3d map of the city. I have been given a data table with coordinates that define degraded buildings within that city.
My intention is to spawn cylinders with a transparent material applied to distinguish those buildings.
My progress so far:

Created a cylinder actor with a translucent material (BP_CylinderActor).
Created the data table from the csv file (DT_DegradedBuildings).
Created the data structure defining the variables driven from the csv information (DS)_DegradedBuildings).
Created the Blueprint to get the latitude and longitude but I am struggling with the functions to spawn the cylinder to each set of coordinates (BP_CylinderSpawner).

My Blueprint so far:

Can you please advise on how to complete this? I am struggling to find the correct functions to populate the cylinders within the level based on the coordinates.

Thank you!

You could just put

‘spawn actor of class ( static mesh actor )’ → ‘set static mesh’

on the end of this?

I did it but it looks like it does not scatter the cylinders in the different coordinates, it places lots of cylinders in one location

There should be cylinders scattered throughout this city… In the right hand side you can see that the cylinders are positioned within runtime.

I believe I need to look again in the for loop blueprint and how it is set up…

Then I would put a print string in the loop to check coordinates are coming from the struct correctly.

It looks like it reads the coordinates

I appended string to the coordinates and printed

Well, the coordinates all look pretty much the same, so the cylinders are all in one place :slight_smile:

These are real coordinates based on World Coordinate System and sit within the same city, therefore this slight differentiation is logical. What I see is that the BP_CylinderSpawner is spawned in the location I positioned in the Editor. So I believe the issue may sit with Cesium and the Editor…

Thank you for your support so far! At least I am getting a better understanding of various things… Probably I need to transfer this to the Cesium forums…

Are the passed in coordinates in the correct scale compared to Unreal’s coordinate system?
Are you sure they aren’t scales by 10 or a 100? The delta between coordinates is minimal.

Try multiplying the outgoing value by 10 or a 100 and see if they snap into the correct places. Do they at least begin to resemble their expected pattern on the landscape.

1 Like

I did multiply incrementally and when I added 1000 to both x and y coordinates if gave me this:

However, looking into the Cesium forums as well there seems to be a coordinates correction process which I need to further understand.

EDIT: This does not apply in this instance. I positioned different elements and the location is correct.

The location which the first cylinder is positioned is the actual actor location positioned in the editor.

Could it be a matter of the map’s static mesh import scale?
You can manually set the scale in the static mesh.
Some 3d programs export by default at a value of 0,1 scale.

If all imported elements were imported at a different scale then the passed in coordinates would require an offset.

The Map is driven by Cesium’s Google 3d Tiles and OSM Buildings overlay. Therefore two different sources work together within the Cesium addin and work smoothly.

I altered my cylinder dimensions within the actor to appear effectively (scaled by 50 in x & y and 100 in z).

I do not believe that Cesium should need rescaling… There aren’t any imported elements… Everything is created within Unreal Engine.

Further to this, I tried the following blueprint script this morning:

Can you please advise if this should work? I have added the static mesh cylinder within my BP_CylinderSpawner instead of creating a separate actor. I also added the make transform and add instance via Construction script.

I managed to resolve this, it was a combination of things, mostly related to how Cesium handles coordinates and the specific functions around it. I am posting the final Blueprint to raise awareness…

BP_Cylinder Spawner, Blueprint to spawn cylinders in specific coordinates via data table and Cesium posted by R4k00n | blueprintUE | PasteBin For Unreal Engine

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.