HoloLens 2 PV camera out of focus - hololens

I am using HoloLens 2 :
The PV camera is often out of focus when I am staring at a very close object ( 30-40 cm from device).
How can I manually set the focus engine to the desired distance (I am not using spatial awareness)?
Thanks,
Eyal
I did not find any API to manually set the focus engine of the PV camera

You can get a look at VideoDeviceController Class to learn how to get or set the camera's focus setting.

Related

Can I get network camera direction?

I am selecting a network camera.
It turned out that the network camera is standardized by ONVIF.
In the ONVIF standard, PTZ control gives speed and operating time.
I want to get the camera orientation (angle).
Can I get the camera orientation with the ONVIF standard?
Furthermore, I want to change the orientation of the camera by giving an orientation (angle).
First of all, is there any camera that can feed back the angle of the camera?
I want to get the camera orientation (angle).
You can look at the GetStatus onvif function to get the current position. It doesn't work with all onvif certified cameras for some reason... (I had trouble with Foscam and Amcrest cameras in the past)
https://www.onvif.org/onvif/ver20/imaging/wsdl/imaging.wsdl#op.GetStatus
I want to change the orientation of the camera by giving an
orientation (angle).
You can look at the AbsoluteMove onvif function to set the position of your camera to the absolute values (angle) you want.
https://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl#op.AbsoluteMove
Here's the list of all "available" functionalities of onvif. I say "available" because, just like the earlier GetStatus, some cameras will return you an error when calling them for some reason...
https://www.onvif.org/onvif/ver20/util/operationIndex.html

How to make image fit screen in Godot

I am new in godot engine and I am trying to make mobile game (portrait mode only). I would like to make background image fit screen size. How do I do that? Do i have to import images with specific sizes and implement them all for various screens? If I import image to big, it will just cut out parts that don't fit screen.
Also, while developing, which width and height values should I use for these purposes?
With Godot 3, I am able to set size and position of sprite / other UI elements using script. I am not using the stretch mode for display window.
Here is how you can easily make the sprite to match viewport size -
var viewportWidth = get_viewport().size.x
var viewportHeight = get_viewport().size.y
var scale = viewportWidth / $Sprite.texture.get_size().x
# Optional: Center the sprite, required only if the sprite's Offset>Centered checkbox is set
$Sprite.set_position(Vector2(viewportWidth/2, viewportHeight/2))
# Set same scale value horizontally/vertically to maintain aspect ratio
# If however you don't want to maintain aspect ratio, simply set different
# scale along x and y
$Sprite.set_scale(Vector2(scale, scale))
Also for targeting mobile devices I would suggest importing a PNG of size 1080x1920 (you said portrait).
Working with different screen sizes is always a bit complicated. Especially for mobile games due to the different screen sizes, resolutions and aspect ratios.
The easiest way I can think of, is scaling of the viewport. Keep in mind that your root node is always a viewport. In Godot you can stretch the viewport in the project settings (you have to enable the stretch mode option). You can find a nice little tutorial here.
However, viewport stretching might result in an image distortion or black bars at the edges.
Another elegant approach would be to create an image that is larger than you viewport and just define an area that has to be shown on every device no matter whats the resolution. Here is someone showing what I am meaning.
I can't really answer your second question about the optimal width and height but I would look for the most typical mobile phone resolutions and ratios and go with that settings. In the end you probably should start with using the width and height ratio of the phone you want to use for testing and debugging.
Hope that helps.

setting a virtual resolution in wayland

Is it possible to set a virtual resolution of a screen, meaning increasing its resolution over its normal resolution (say, I've got a 1920x1080 screen, can I use it like it was a 3640x2160 screen)?
With X it was easy, just xrandr --scale 2x2, but with wayland I can't seem to find a way to do it...
It would be to set up a multi-screen environment, with one good screen and a bad screen, and I need to double the resolution of the bad screen, to have the windows about the same size in both screens, which is my goal.
I've read somewhere about multi-screen scaling, but couldn't fine more informations about
Thank you for your help
If you are using weston compositor then you can specify the "scale" factor in weston.ini file under [ouput] section please refer here http://manpages.ubuntu.com/manpages/bionic/man5/weston.ini.5.html
scale=factor
The scaling multiplier applied to the entire output, in support of high resolution("HiDPI" or "retina") displays, that roughly corresponds to the pixel ratio of the display's physical resolution to the logical resolution. Applications that do not support high resolution displays typically appear tiny and unreadable. Weston will scale the output of such applications by this multiplier, to make them readable.Applications that do support their own output scaling can draw their content in high resolution, in which case they avoid compositor scaling. Weston will not scale the output of such applications, and they are not affected by this multiplier.
An integer, 1 by default, typically configured as 2 or higher when needed, denoting
the scaling multiplier for the output.

Auto Layout Compatibility

I thought I had a grasp on auto layout, but when I test it on my 3.5 iPhone it does not look like a UI should.
The question is in the Simulated Metrics What should the size of the device be ? Inferred , Freeform , Detail ??
Keep in mind I am building for all iPhone models 3.5 , 4 , 4.7 , 5.5...
Thanks much.
JZ
I think, setting constrains through auto layout doesn't require you to concentrate on the Simulated Metrics. It could be freedom or fixed. What you need to know is your stimulator frame's size to calculate your component's contains.
For example, lets assume, you have an ImageView and you want that image view to consume 50% of your devices screen. You can use aspect ratio to do that but to calculate the ratio you need to know the stimulator's frame size.
If you select freedom, xCode will show you what is your stimulator's width and height. If it is 400X600 then you know that to be 50% of your screen size, your image view needs to be 200X300. So, you can then just go and set your constrains accordingly to make your image view look like 200X300 in your stimulator and then when you will test in any device, if you have set the constrains properly, you will have a constant behaviour.

"Virtual screens" in 3D engines (displaying on a wall another portion of the 3D world)

To clarify the technical problem i have, i want to describe the scene i have in mind:
In a 3D computer simulation, I want to build a kind of cabin (cube form) that stands isolated in a large plane. There's 1 door to enter the cabin. Next to this door I want to show a movie playing (avi file or something) on the wall of the cabin.
If you enter the cabin, on all 4 sides I want to show a virtual 3D landscape projection that is based on the input of the video projected outside: every pixel in the video will be represented as a cube (rgb -> height width depth). The resulting landscape of cubes needs to be projected on the inside walls of the cabin. And as a user, you will not be able to walk into this projection (it's a virtual window, not a portal).
Technically, for me this translates into these questions: i want to
display a movie inside the 3D world on a wall
access the pixel data of this movie
transform on the fly these pixels into 3D representation of cubes
show these cubes as a virtual projection on a wall in the game. (as a kind of visual teleport that you can't cross)
I was wondering which 3d engine would allow this? I don't mind any programming language. I'm fluent in mono/.net or java, but i can manage c++ or other languages (as long as the engine is well documented).
Kind Regards,
Ruben.
ps:
I don't know if this question is of interest to anybody else. At least not in the functional kind of way. But maybe it triggers a hypothetical interest :)
Any engine that supports dynamic texture maps and multiple viewports (rendering surfaces).
render the scene you want on your wall
texture wall with the output of 1
render your room scene
Many engines support this. The Unreal Tournament Engine (UT2004) supports this, as evidenced by the dynamic texture on carried sniper scopes (example, Killing Floor). Security camera screens in Half-life 2 do this as well (source engine).

Resources