Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Constrained Rectangle

For general discussion related FlowStone

Constrained Rectangle

Postby willzz32 » Mon Mar 30, 2020 5:09 pm

Hi All

I'm hoping i may be able to get some help with an exe i'm trying to create. I'm trying to create a rectangle within a space that changes raito but is constrained within the space of a second rectangle. It's mainly to workout a projection canvas and then drop 16:9 projectors 'Rectangles' over the canvas.
I thought this would be easy but i can't seem to crack it, It's probably something very simple but i just can't see the solution.
Any help would be much appreciated.
Attachments
calc 2.fsm
(524.45 KiB) Downloaded 821 times
willzz32
 
Posts: 20
Joined: Thu Jul 29, 2010 7:59 pm

Re: Constrained Rectangle

Postby martinvicanek » Mon Mar 30, 2020 5:37 pm

I was not sure from your schematic what your goal is so I'll try to answer your question.

Suppose you have a rectangle with sides a and b, and you want to fit it into another rectangle with sides A and B, while maintaining the aspect ratio a/b. Your scale factor is

scale = min(A/a,B/b)

so your new rectangle will have the dimensions

a' = scale*a
b' = scale*b

Does that answer your question?
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Constrained Rectangle

Postby willzz32 » Mon Mar 30, 2020 5:43 pm

Thanks for pointing me in the right direction. It most definitley helps.
I'm just creating a projection calculator to help me setting up projection on shows. I know there's a few out there already but i just wanted to see if i could do my own.
I really appreciate the fast response thank you. Matt
willzz32
 
Posts: 20
Joined: Thu Jul 29, 2010 7:59 pm

Re: Constrained Rectangle

Postby martinvicanek » Mon Mar 30, 2020 7:50 pm

Here is an example.
Attachments
FitImageIntoCanvas.fsm
(783.71 KiB) Downloaded 830 times
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Constrained Rectangle

Postby willzz32 » Mon Mar 30, 2020 8:43 pm

Hi Martin

Thank you very much for the example.

It really helps me understand. Sorry for being a bit slow.
willzz32
 
Posts: 20
Joined: Thu Jul 29, 2010 7:59 pm

Re: Constrained Rectangle

Postby pshannon » Mon Mar 30, 2020 11:40 pm

thanks Martin, however, where is the rest of the image? lol
User avatar
pshannon
 
Posts: 144
Joined: Fri Jan 02, 2015 3:08 am

Re: Constrained Rectangle

Postby martinvicanek » Tue Mar 31, 2020 2:43 pm

http://www.lenna.org/full/len_full.html
Warning: may contain nudity!
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Constrained Rectangle

Postby pshannon » Tue Mar 31, 2020 2:49 pm

martinvicanek wrote:http://www.lenna.org/full/len_full.html
Warning: may contain nudity!


Thanks, she is nice, but I was just playing around. Teasing us with the half image. :)
User avatar
pshannon
 
Posts: 144
Joined: Fri Jan 02, 2015 3:08 am

Re: Constrained Rectangle

Postby Spogg » Tue Mar 31, 2020 3:44 pm

You do know that as moderators we really ought to delete porn.
But this is art, right?
Nice proper real and valid art.
And not porn, right?

Cheers

Spogg
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Constrained Rectangle

Postby martinvicanek » Tue Mar 31, 2020 4:10 pm

No, not porn. Art.
I would never post porn.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm


Return to General

Who is online

Users browsing this forum: No registered users and 97 guests