# Thread: Trying to create the Tour of Darkness Strafe template

1. ## Trying to create the Tour of Darkness Strafe template

Guys,

I'm trying to work out this old post to see if I can create the call of darkness strafe template.

http://www.fantasygrounds.com/forums...custom+pointer

Does anyone here understand the maths / spline curves that can explain to me how I work out what the 4 points I need to create for each control point?

PW and I looked at this a while back and did not understand it, but would like to try again..

2. I'm assuming that you don't need to do the curves in order or in a specific direction (i.e. they are all independently drawn)

To do the lozenge shape you'll need 6 segments (one for each quarter circle and two straight segments)

dimensions I used Circle diameter 2", straight segments 7" long, total length 9"

I don't do lua and I haven't done more than write xml modules for my own use, but by cribbing from the example you gave, this should work if you insert it in place of the cone section.

Code:
```        -- strafe template facing in the negative y direction
local kappa = 4/3*(sqrt(2)-1);
-- circle segments at the origin
local segment = { { startx, starty },
{ startx + kappa*u, starty },
{ startx + u, starty - (1 - kappa)*u },
{ startx + u, starty - u } };
table.insert(segments, segment);
local segment = { { startx, starty },
{ startx - kappa*u, starty },
{ startx - u, starty - (1 - kappa)*u },
{ startx - u, starty - u } };
table.insert(segments, segment);
-- straight segments
local segment = { { startx + u, starty - u },
{ startx + u, starty -2*u },
{ startx + u, starty - 7*u },
{ startx + u, starty - 8*u } };
table.insert(segments, segment);
local segment = { { startx - u, starty - u },
{ startx - u, starty -2*u },
{ startx - u, starty - 7*u },
{ startx - u, starty - 8*u } };
table.insert(segments, segment);
-- circle segments at the far end
local segment = { { startx, starty -9*u },
{ startx + kappa*u, starty -9*u },
{ startx + u, starty - (8 + kappa)*u },
{ startx + u, starty - 8*u } };
table.insert(segments, segment);
local segment = { { startx, starty -9*u },
{ startx - kappa*u, starty -9*u },
{ startx - u, starty - (8 + kappa)*u },
{ startx - u, starty - 8*u } };
table.insert(segments, segment);```

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•