How do I draw a line for Collision Detection?

VRTool software support forum

How do I draw a line for Collision Detection?

Postby Asmith » Fri Feb 06, 2015 8:19 am

Hi, I got collision detector to work by manually entering the full path " C:\Program Files (x86)\VRTool\monoBmpGSHHS_24k12k.bmp ". But now I need to direct it to head the right way around the course, rather than as straight a line as possible. I read in another post I should use the ' line ' tool in the Collision Detector tool, but it does not does not draw a line. If I click on it and go the the map, and click on the map, then the last other tool I used is in effect, eg zoom, etc. I have tried drawing routes as ' lines ' but that has no impact.
Posts: 6
Joined: Sat Nov 22, 2014 11:13 am

Re: How do I draw a line for Collision Detection?

Postby omar » Fri Feb 06, 2015 11:21 am

The line tool in collision detection (CD) module was designed to test
that module, by drawing a line segment and checking if it hits land.

To use it:
* With the bitmap not stretched, scroll the chart to the desired place (using the scroll bars).
* Click the first point in the white area (sea).
* Click a second point. A line segment is drawn. If it crashes into land, a beep sounds
and the line will not reach the second point, stopping at the crash site
(meaning of course that a collision was detected).

Tip: The line becomes part of the bitmap in memory,
so you may use those lines to define sea areas you want to exclude
from routing ( like the wrong side of a mark ).
Draw a couple lines to make a barrier.

Note that the lines do not become part of bitmap file (are not persistent).
If you restart VRTool or click load to reload the bitmap, the lines disappear.

You may add the lines to a copy of the CD bitmap using image edition software
like Windows Paint or Photoshop. This will make the lines persistent.

Make sure:
* Use fat lines (at least 2 pix of line width)
* Save the bitmap in 1 bit-per-pixel BMP format (Windows monochrome bitmap).
* Photoshop seems to change the bitmap palette, switching black and white.
Because of a bug in current VRTool code, land becomes sea. :mrgreen:
I will correct this in the next release.
In the mean time, as a workaround, you may use Photoshop command
to obtain a negative map.

The size of that bitmap is another concern. Of course you want a large bitmap,
with the best possible resolution. But if it is too big, Windows will not allow
it to be loaded. I found 24000 x 12000 pixels to be ok for most computers.
30000 x 20000 will work in recent computers with enough memory,
but Windows Paint fails to open it. You cannot go beyond 30000.

One way to reach better resolution is to make a detail bitmap
covering only the area of interest. :idea:

I have no idea which resolution the VR games use.
This is up to you to find out. Seems to be pretty high. ;)
User avatar
Site Admin
Posts: 497
Joined: Thu Apr 30, 2009 11:00 am

Re: How do I draw a line for Collision Detection?

Postby Asmith » Sat Feb 07, 2015 9:42 am

Hi Omar, Many Thanks!
In the end I used photoshop to add a nice thick line, made the seas black, and put that back in the VRtool directory under program files (x86).

But the real trick, in the case of having my destination already set to Auckland was to set the maximum angle to destination to 110 but also the number of tree branches 110 (just increasing the max. angle did not do it alone)

Even then the route at the start is inefficient for some reason. I found that out by putting my destination on the far side of philippines and then a max angle of 80 and tree branches set at 60 give me the most efficient route by many hours.

In anycase again thanks for your indepth answers, which did help me find my problem.

Posts: 6
Joined: Sat Nov 22, 2014 11:13 am

Return to VRTool Forum