How do I set angle of UserMedia object?

  • 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?

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

  • 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?

  • You don't need to do it every tick.

    Add a button.

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

  • 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!

  • Natano

    Why have you reported Newt for a Warez violation twice?

    Please stop doing this.

  • Natano

    Why have you reported Newt for a Warez violation twice?

    Please stop doing this.

    Wat?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Natano

    Why have you reported Newt for a Warez violation twice?

    Please stop doing this.

    Sorry... Accidentally))

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)