Triagular Area - Mouse Over

Until our dedicated user library is in place you can post examples and modules here

Moderators: electrogear, exonerate

Triagular Area - Mouse Over

Postby DigitalWhiteByte on Mon Jun 21, 2010 1:55 am

Another small example of how to implement a "Mouse Over Area", geometrically customized.
:D
Attachments
Triangular_Area_DWB.osm
Uploaded Version
(5.38 KiB) Downloaded 110 times
Last edited by DigitalWhiteByte on Mon Jun 21, 2010 9:40 am, edited 1 time in total.
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: Triagular Area - Mouse Over

Postby aliasant on Mon Jun 21, 2010 8:29 am

DigitalWhiteByte wrote:Another small example of how to implement a "Mouse Over Area", geometrically customized.
:D


SM crashes for me when I try to load this.
Maybe you have a Live Audio out thats not compatible with my pc?
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Triagular Area - Mouse Over

Postby MegaHurtz on Mon Jun 21, 2010 9:29 am

cool :)
User avatar
MegaHurtz
smaniac
 
Posts: 1522
Joined: Mon Aug 11, 2008 5:29 pm
Location: Eindhoven/Netherlands

Re: Triagular Area - Mouse Over

Postby DigitalWhiteByte on Mon Jun 21, 2010 9:39 am

aliasant wrote:
DigitalWhiteByte wrote:Another small example of how to implement a "Mouse Over Area", geometrically customized.
:D


SM crashes for me when I try to load this.
Maybe you have a Live Audio out thats not compatible with my pc?

In this schematic, there is not any primitive external. :(
I uploaded it anyway, in the previous post.
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: Triagular Area - Mouse Over

Postby DigitalWhiteByte on Mon Jun 21, 2010 9:46 am

MegaHurtz wrote:cool :)

Now the next step, be able to create an algorithm with SynthMaker to obtain the triangulation of a any polygon,
so as to have the area of any shape.
But on this I would need help of some expert in graphics. ;)
Or a beautiful, new Primitive ... Malc? O:)
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: Triagular Area - Mouse Over

Postby MegaHurtz on Mon Jun 21, 2010 9:58 am

expert graphix guy :D
User avatar
MegaHurtz
smaniac
 
Posts: 1522
Joined: Mon Aug 11, 2008 5:29 pm
Location: Eindhoven/Netherlands

Re: Triagular Area - Mouse Over

Postby aliasant on Mon Jun 21, 2010 10:02 am

Sorry. After crashing several times and emptying recovery folder.... I realized I had Reaper running in the back....
Not sure why that was a problem but it was.
:blush:
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Triagular Area - Mouse Over

Postby aliasant on Mon Jun 21, 2010 10:08 am

I have asked Malc for a primitive before that can output the alpha channel / inversed alpha from a bitmap or the output from eg. Draw Ellipse primitive.

Both would be nice and shouldnt be that hard or?
Its quite possible that Im asking for something stupid again since I havnt really thought it thru, as usuall.

There is another way to do that. Just create an image in 2 colors and if the mouse hovers over a pixel that has color "A" then True. Havn tested that yet but Im gonna waste some time on it now.

Oops.
Someone already made it for us. It was the "Thumbs Up" if you guys remember that.
I cant remember who made it but here is a small mod of it that I had.
(I know Im of track but my other option is to do something real like paying a couple of bills.....)
Attachments
Mouse over Alpha.osm
(56.88 KiB) Downloaded 89 times
Last edited by aliasant on Mon Jun 21, 2010 10:16 am, edited 1 time in total.
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Triagular Area - Mouse Over

Postby DigitalWhiteByte on Mon Jun 21, 2010 10:13 am

MegaHurtz wrote:expert graphix guy :D

do you think this can be a faster algorithm?

http://www.ecse.rpi.edu/Homepages/wrf/R ... npoly.html
Code: Select all
int pnpoly(int nvert, float *vertx, float *verty, float testx, float testy)
{
  int i, j, c = 0;
  for (i = 0, j = nvert-1; i < nvert; j = i++) {
    if ( ((verty[i]>testy) != (verty[j]>testy)) &&
    (testx < (vertx[j]-vertx[i]) * (testy-verty[i]) / (verty[j]-verty[i]) + vertx[i]) )
       c = !c;
  }
  return c;
}

Argument | Meaning 
nvert = Number of vertices in the polygon. Whether to repeat the first vertex at the end is discussed below. 
vertx, verty = Arrays containing the x- and y-coordinates of the polygon's vertices. 
testx, testy = X- and y-coordinate of the test point. 
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: Triagular Area - Mouse Over

Postby DigitalWhiteByte on Mon Jun 21, 2010 10:44 am

aliasant wrote:There is another way to do that. Just create an image in 2 colors and if the mouse hovers over a pixel that has color "A" then True. Havn tested that yet but Im gonna waste some time on it now.

Wow, this system is really simple. :D
I modded your version a little, to get on or off the area.
mod_DWB_Mouse_over_Alpha.osm
(71.44 KiB) Downloaded 100 times

aliasant wrote:(I know Im of track but my other option is to do something real like paying a couple of bills.....)

I share your point of view, but do not have any information about any structural SynthMaker update xP ,
then while playing with what we have :S
User avatar
DigitalWhiteByte
smanatic
 
Posts: 693
Joined: Thu Mar 12, 2009 1:07 am
Location: Milano - Italy

Re: Triagular Area - Mouse Over

Postby MegaHurtz on Mon Jun 21, 2010 10:54 am

DigitalWhiteByte wrote:
MegaHurtz wrote:cool :)


But on this I would need help of some expert in graphics. ;)


Ali Tha Man!!
User avatar
MegaHurtz
smaniac
 
Posts: 1522
Joined: Mon Aug 11, 2008 5:29 pm
Location: Eindhoven/Netherlands

Re: Triagular Area - Mouse Over

Postby aliasant on Mon Jun 21, 2010 10:56 am

:)
Nice.

A simple way to use this on a full build is simply, take a snapshsot of your plugin.
Open that image in Photoshop or similar.
Make a new layer on top and draw/paint the areas you want the mousepointer to react on and save as a transparent .png.
Load that into the bitmap and then hide the bitmap by pressing the Eye icon on the bitmap module.

Perfect mouse area done in less then 2 minutes.
I think you should be able to add more areas to that same png by using different colors/area instead of the alpha but I havnt tried that yet.

I think maybe maybe it was my favourite guy mwvdlee that made that module in the first place.
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden


Return to Examples

Who is online

Users browsing this forum: No registered users and 0 guests

cron