Topic: Line drawing doesn't go through points

We have a bunch of markers, and wish to draw lines connecting them. When using the Drawing API, none of the lines are passing through the marker points.

I've had to scale my markers down to .005f, as in the HTC Vive, they come out huuuuuge otherwise. I'm not sure if this would affect it, and they would otherwise be in the correct place?

I set the line weight to .001f, as again, it just covers the entire map otherwise.

My code's fairly simple:

foreach (double[] coord in geoms)
        {
            Vector2 pos = new Vector2((float)coord[0], (float)coord[1]);
            OnlineMapsMarker3D marker3D = control.AddMarker3D(pos,spawnPrefab);
            marker3D.scale = 0.005f;
            //positions.Add(pos);
        }
        double[] positions = geoms.SelectMany(i => i).ToArray();
        OnlineMapsDrawingLine line = new OnlineMapsDrawingLine(positions, Color.green, .001f);
        OnlineMaps.instance.AddDrawingElement(line);


Any idea?

Re: Line drawing doesn't go through points

Hello.

Possible there is not enough accuracy with such a small line thickness.
Please show your Online Maps settings and GameObject Transform.
We will try to reproduce and fix the problem.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Line drawing doesn't go through points

Hi,

I tried playing around with width/height of map. It was set to 1920x1920. I tried setting it to 256x256 and it worked, so I thought it might be a resolution issue. Then I tried 512, then 1024, and they worked. I tried 1080, and it was wrong again. Then I tried 2048, and it was fine (albeit a bit slow).

It seems to only work when it's a power of 2. Is it because the tiling is set in powers of 2?

Re: Line drawing doesn't go through points

Hello.

We were able to reproduce the problem.
Yes, this is because the size is not 256 * N.
Thank you for reporting the problem.

We will try to fix it.
But this is perhaps the most deep and difficult problem that I ever seen (in Online Maps), and I do not know how long it will take.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Line drawing doesn't go through points

Ah, I see. I was trying to map my own lines to the coordinate system in OnlineMaps, but couldn't figure out how to. I tried use GetWorldPosition, and then set the lines at that point, but that did not seem to work. Do you potentially know why?

Re: Line drawing doesn't go through points

When the size is not 256 * N, the coordinate transformation methods does not work properly, and almost nothing is correctly positioned.
So currently use the right size.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.