How do I set angle of UserMedia object?

Get help using Construct 2

Post » Sun Aug 07, 2016 4:27 pm

Hi.

Trying to implement QR-code scanner (using pode_qrdecode plugin). Planning to run it on windows pads via NW.js (as a part of QR-based electronic guide solution for our little museum). The pads are 8'' so they have portrait layout, and this is good for design. But it looks like built-in camera is by default lanscape-orientated, making the picture in UserMedia object look 90 degrees rotated and impossible to aim. Found the UserMedia object doesn't have "angle" property. Tried to rotate it starting the "Rotate" behavior and then stopping it at the right moment, but, besides it's funny, it's not always as accurate. Found a walkoround using "ManyCam" utility (it creates a virtual camera based on a real one with any user effects applied, incl. rotation), but free version has its limitations and, anyway, it's a perfomance hit. Is there any simpler solution I missed?
B
4
Posts: 8
Reputation: 216

Post » Sun Aug 07, 2016 5:08 pm

Load the url into a sprite, set its angle, and paste it into the Paster object.
Image ImageImage
B
169
S
50
G
174
Posts: 8,331
Reputation: 110,806

Post » Sun Aug 07, 2016 5:37 pm

newt wrote:Load the url into a sprite, set its angle, and paste it into the Paster object.


Thank you for your reply!
Just tried it. "Sprite -> Load image from UserMedia.SnapshotURL" every tick. Yes, this works, but at 2 FPS on my 4GHz i7. And on the pad there is 1533MHz "intel atom"... Any other ideas?
B
4
Posts: 8
Reputation: 216

Post » Sun Aug 07, 2016 5:46 pm

You don't need to do it every tick.
Add a button.

https://www.dropbox.com/s/oz49k379l34xu ... .capx?dl=0
Image ImageImage
B
169
S
50
G
174
Posts: 8,331
Reputation: 110,806

Post » Sun Aug 07, 2016 8:02 pm

newt wrote:You don't need to do it every tick.
Add a button.

https://www.dropbox.com/s/oz49k379l34xu ... .capx?dl=0


The problem is – I need it every tick, realtime. Look here:

https://www.dropbox.com/s/3k8qlassokux5 ... 9.jpg?dl=0

There is a UserMedia object on screen, showing stream from device's cam. But, as you see, it's 90° rotated, as it is by default, probably defined by camera driver. Other applications, like "Camera" or Skype, do the rotation themselves. But, as far as I found, Construct doesn't. The correct picture is needed realtime, because user is expected to aim camera at QR-code. Trying to do it with picture rotated 90° is quite a pain.

(a bit later)
However, playing now format and quality options, I found out that a sprite object can be updated with camera jpeg snapshot quite fast! Actually, 10 fps on pad is not a problem, and that's more than enough. Rotating it 90° makes what I want – realtime vertical stream from camera, so the problem is solved! Thank you for a good idea!
B
4
Posts: 8
Reputation: 216

Post » Sun Aug 07, 2016 8:05 pm

@Natano

Why have you reported Newt for a Warez violation twice?

Please stop doing this.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,424
Reputation: 59,534

Post » Sun Aug 07, 2016 8:29 pm

zenox98 wrote:@Natano

Why have you reported Newt for a Warez violation twice?

Please stop doing this.


Wat?
Image ImageImage
B
169
S
50
G
174
Posts: 8,331
Reputation: 110,806

Post » Sun Aug 07, 2016 10:53 pm

zenox98 wrote:@Natano

Why have you reported Newt for a Warez violation twice?

Please stop doing this.


Sorry... Accidentally))
B
4
Posts: 8
Reputation: 216


Return to How do I....?

Who is online

Users browsing this forum: 25games, Artcadev and 26 guests