forum

How to convert veikk tablet area to hawku tablet driver

posted
Total Posts
6
Topic Starter
realBlueDuck

How to convert veikk tablet area to hawku tablet driver


As the title suggests, in this forum I'll briefly explain how you can convert veikk tablet area mapping to milimeters.
In this case, I'll convert my veikk area mapping to milimeters.


IMPORTANT


If you're lazy to do the math, then you can use my online calculator to convert veikk tablet area mapping to milimeters. https://cantcode023.github.io/veikk-to-mm/

Introduction


Before I get into the math, I'd like to point out the problems and the solution to this topic. The obivous problem is that veikk driver uses a different unit, we'll call it veikk unit (vk) while tabletdriver uses milimeters unit (mm), so a formula has to be invented to convert these units. I also encountered other problems while trying to invent the formula, the main problem was the positoning. Veikk area mapping works as a pivot or vertices and an area has 8 vertices while tablet driver works more like a margin or padding so it became hard for me to find the correct formula for the positioning mapping (i am bad at math :p)

Math in action






For the area mapping unit conversion, it was pretty easy. As the image below suggests, tablet driver max width is 152.4 mm with a max height of 101.6 mm and veikk driver max width is 30480 vk with a max height of 20320 vk. With this in mind, all I had to do is a simple algebra.

Width
152.4 mm = 30480 vk
152.4 mm / 152.4 mm = 30480 vk / 152.4 mm
1 mm = 200 vk

Height
101.6 mm = 20320 vk
101.6 mm / 101.6 mm = 20320 vk / 101.6 mm
1 mm = 200 vk

With this values, we can already convert vk to mm by dividing by 200. For example, width: 30480 and height: 20320, so when we divide it, 30480/200 = 152.4 mm, 20320/200 = 101.6 mm.

Now we get into the juicy part, which is converting veikk area mapping into tablet driver positioning mapping. Honestly this was a bit tricky, it took me almost 2 hours to figure out the formula. The main difference between tablet driver mapping and veikk driver mapping is that tablet driver has only one pivot point, or an anchor. If you set the X position/margin to 0, the area map will be at the left border but at the center meanwhile in veikk mapping, there is 8 pivot/vertices but no anchors, so if you set the left to 0, the 3 vertices that makes up a line of left will be at the left border area. This sounds confusing look at these images below.





How I solved it


I really had to be creative when solving this, after hours of thinking, I came up with a solution.
First of all, in veikk area mapping, I get the distance from right border to right line of my area and then divide that by 200, this'll convert the distance from vk to mm, same with bottom border.



After I have this, I then need to get the X position for the right border in tablet driver, this is pretty easy, this is the formula that I used.

76.2 + ((152.4 - converted width)/2), where 76.2 is the X centered position, 152.4 is the max width, converted width is the width that has been converted from vk to mm, and i divided 2 to only get one side. This may sound confusing, I myself am confused by this explanation :/

and for the Y position for bottom border, the formula is pretty much the same, just slightly changed, (50.8 + ((101.6 - height)/2))

after I have both right border and bottom border, I can get the X position. For x position, what I can do is subtract the right border (tabletdriver) with distance from right border (veikk driver). Same with Y axis but subtract with bottom border with distance from bottom border.

The positioning formula would look something like this

let X = (76.2 + ((152.4 - converted width)/2)) - ((30480 - veikk right area)/200);
let Y = (50.8 + ((101.6 - converted height)/2)) - ((20320 - veikk bottom area)/200);

The formula as a whole would look something like this

let width = (veikk right area - veikk left area) / 200;
let height = (veikk bottom area - veikk top area) / 200;
let X = (76.2 + ((152.4 - converted width)/2)) - ((30480 - veikk right area)/200);
let Y = (50.8 + ((101.6 - converted height)/2)) - ((20320 - veikk bottom area)/200);

Now lets put this formula into the test!



The image above is my veikk area mapping.

width = (21111 - 5996) / 200 = 75.575
height = (14848 - 5861) / 200 = 44.935
X = (76.2 + ((152.4 - width)/2)) - ((30480 - 21111)/200) = 67.7675
Y = (50.6 + ((101.6 - height)/2)) - ((20320 - 14848)/200) = 51.7725



That's pretty much it! and like I said before, you don't have to do all this math, you can use my online calculator to convert vk unit to mm unit easily. https://cantcode023.github.io/veikk-to-mm/

credits:
users/10999079 - helping with area conversion
me - helping with positioning conversion
you - reading my first forum on osu
Reyalp51
hi again
anaxii
Damn, for a first forum post, it's pretty complete I stg
Duck o-o
ummmm cant u just use this convert area thing?
Naiad

Dementedduck wrote:

ummmm cant u just use this convert area thing?
LMAO this is awkward.

I went through all the math myself about a year ago to convert my area and I am only now hearing about this.
anaxii

Naiad wrote:

Dementedduck wrote:

ummmm cant u just use this convert area thing?
LMAO this is awkward.

I went through all the math myself about a year ago to convert my area and I am only now hearing about this.
Simplicity is always the key to everything
Please sign in to reply.

New reply