DICE PACKS BUNDLE
Page 6 of 6 First ... 456
  1. #51
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    Hrm. That's what I had before... and it stopped working way back.. I've just gotten around to trying to fix it.
    I had the whole Dulox Toolkit thing setup... and it was working for Equilateral Triangles... but.. yeah.. not since November of 2016 apparently.
    It was drawing the end points but none of the lines..

    Never did figure out how to make the Hexagon work though.
    Code:
    	<windowclass name="imagewindow" merge="join">
    		<sheetdata>
    			<imagecontrol name="image">
    				<default snap="off" drawingsize="500,500" snaphex="vertexandcenter" gridtype="hexrow" />
    				<pointertypes>
    					<arrow>
    						<icon>pointer</icon>
    						<label>Draw Arrow</label>
    					</arrow>
    					<circle>
    						<icon>pointer_circle</icon>
    						<label>Draw Circle</label>
    					</circle>
    					<custom name="60ConePointer">
    						<icon>pointer_cone</icon>
    						<label>Draw 60-Degree Cone</label>
    					</custom>
    					<custom name="TrianglePointer">
    						<icon>pointer_cone</icon>
    						<label>Draw Triangle</label>
    					</custom>
    					<custom name="HexPointer">
    						<icon>pointer_circle</icon>
    						<label>Draw Hex</label>
    					</custom>
    				</pointertypes>
    			</imagecontrol>
    		</sheetdata>
    	</windowclass>
    I suppose now I can default 60 degrees for the cone pointer and just set that one as a standard pointer.
    Code:
    <cone>
      <icon>pointer_cone</icon>
      <label>Draw Cone</label>
    </cone>
    I'm currently trying to figure out where it actually broke if you are telling me that the onBuildCustomPointer is still working. Hrm.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  2. #52
    I'm assuming that it is all still working, as it is used for almost all the Savage Worlds pointers and I haven't heard any issues. Also, I haven't touched that code since 2016.

    JPG

  3. #53
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    OK.. so I figured it out and triangles are working again.

    Now on to Hexagons.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  4. #54
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    OK.. so I took the one side of the Equilateral Triangle and that draws one side of the Hexagon.. all I need to do.. (in theory) is flip it around 5 more times to get the various other sides.
    I could probably use a little help with the math... it's been a while.
    Code:
    function fpLineCurve(nStartLineXCoord,nStartLineYCoord,nEndLineXCoord,nEndLineYCoord,nOffset)
         local aCurve = {{nStartLineXCoord,nStartLineYCoord-nOffset},
                         {nStartLineXCoord,nStartLineYCoord-nOffset},
                         {nEndLineXCoord,nEndLineYCoord-nOffset},
                         {nEndLineXCoord,nEndLineYCoord-nOffset}};
         return aCurve;
    end
    
    function fpHexPointer(aShapeCurves,nRadius)
    	local nSide = math.sqrt((nRadius*nRadius)+((nRadius*nRadius)/3));
    	table.insert(aShapeCurves,fpLineCurve(-nSide/2, 0, nSide/2, 0, nRadius));
    	table.insert(aShapeCurves,fpLineCurve(-nSide/2, 0, nSide/2, 0, -nRadius));
    end
    So the 0 is the point on the offset where it's drawing the line.. and half the side + or - gets you to the ends.
    Reverse the Radius gets you the opposite line.
    If I set up 3 of these.. it makes a Hexagon.
    Last edited by Blackfoot; February 18th, 2019 at 16:52.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  5. #55
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    Victory!!
    The Hexagonal Pointer!
    Code:
    function fpHexPointer(aShapeCurves,nRadius)
    	local nSide = math.sqrt((nRadius*nRadius)+((nRadius*nRadius)/3));
    	table.insert(aShapeCurves,fpLineCurve(-nSide,0,-nSide/2,-nRadius,0));
    	table.insert(aShapeCurves,fpLineCurve(-nSide,0,-nSide/2,nRadius,0));
    	table.insert(aShapeCurves,fpLineCurve(-nSide/2,0,nSide/2,0,-nRadius));
    	table.insert(aShapeCurves,fpLineCurve(-nSide/2,0,nSide/2,0,nRadius));
    	table.insert(aShapeCurves,fpLineCurve(nSide,0,nSide/2,-nRadius,0));
    	table.insert(aShapeCurves,fpLineCurve(nSide,0,nSide/2,nRadius,0));
    end
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  6. #56
    Just to geek out on trig for a moment. Equal width/distance from the origin point is not an equilateral triangle, as Moon said. If you think of an equilateral triangle being two right triangles back to back, then each of those right triangles will have tan(x) = 0.5, where x is the angle between adjacent and hypotenuse. The total angle is then 2x, because, two triangles. tan(x) = 0.5 is the same as arctan(0.5) = x, which is ~26.56. Double that, and you get 53.12, or, what Moon said. There will be a quiz on Monday...

    https://www.mathsisfun.com/sine-cosine-tangent.html

    Since equilateral triangles have 3 60 degree angles, by the same logic as above, the ratio of distance/width is 2 * tan(30) = ~1.15
    Last edited by darrenan; February 20th, 2019 at 15:06.

  7. #57
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    Dork.

    Yeah yeah... I meant oh bother.. Whatever. You know what I meant.

    Check out my HEX pointer!

    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  8. #58
    who has two thumbs and was in math club in high school? this guy :-)

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

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

Log in

Log in