Cardboard Parameters - google-cardboard

I am developing a Browser Based Cardboard App which needs the following details of various cardboards:
Screen to lens distance
Inter-lens distance
Screen vertical alignment
Tray to lens-center distance
Distortion coefficients
For these cardboards:
Aura VR v2
LaminatedCardboardV1
Cardboard I/O 2015

Related

Game Dev - Making low res geometric shapes

I've used two 2d game frameworks (SpriteKit and Corona SDK) and have not found a way to programmatically create low res 2d shapes. They seem to be more centered on using sprites or image files.
For an example look at eliss infinity https://www.youtube.com/watch?v=VuKGJyJZY7s
How is something like this done?

Kinect Background Removal and Particle dynamics using opengl?

I'm making an application with KINECT SDK 1.8, OpenGL and DirectShow.
My objective is to extract the human with KINECT background removal API and add avi video's frame as a background using DirectShow's IVMR9WindowlessControl9:GetCurrentImage. Then draw about 1000 square textures which have some transparency to make a fire(particle dynamics).
I add video background if the extracted image's pixel's alpha is 0. If the pixel's alpha is 0, I add video frame's pixel in there.
When KINECT didn't detect human, and video frame's pixel fills the background, the fire comes out very well.
The problem is this : When KINECT detected human, and video frame's pixel fills the background except the human area, the fire comes out, but there are few particles consisting fire, and sometimes, the other particles which weren't showed up when the human was detect showed up and then disappear in a moment.
After the KINECT couldn't detect the human, the hidden particles just show up and it runs very well.

Android: complex UI design

I have to make the Android app with this screen (it'll be Android version of existing iOS app):
You can see that there're several images, buttons and text label in very specific positions relative to each other.
The problem is that Android devices are very various in screen sizes and dimensions. How to keep the elements' relative sizes on different screens?
Taking this picture as an example, I can calculate, for example, ratio between screen width and circle radius. However, how to keep this ratio with the multitude of Android screens?
You have to create multiple resources for your app. Android has 4 resolutions (ldpi,mdpi,hdpi and xhdpi) and 4 generalized screen sizes (small, medium, large and extra large). So you have to make 4 layouts (or 3 if you don't plan on supporting tablets, since tablets come under the extra large category) to support the screen sizes.
Here's a general guide:
put layouts for small, medium, large and extra large in your res/ folder as follows:
res/layout/sample_layout.xml // default layout
res/layout-small/sample_layout.xml // layout for small screen size
res/layout-large/sample_layout.xml // layout for large screen size
res/layout-xlarge/sample_layout.xml // layout for extra large screen size
you can also use
res/layout-land/sample_layout.xml for landscape orientation for all screen sizes or you can target landscape layouts for specific screen sizes as res/layout-medium-land/sample_layout.xml
note that all the layouts have the same name.
once you have your layouts ready, you need to take care of image resolutions also
once again in your res/ folder add images like this:
res/drawable-ldpi/sample_image.png // low density
res/drawable-mdpi/sample_image.png // medium density
res/drawable-hdpi/sample_image.png // high density
res/drawable-xhdpi/sample_image.png // extra high density
once again, all the images have the same name.
general guidelines for designing images are:
ldpi is 0.75x dimensions of mdpi
hdpi is 1.5x dimensions of mdpi
xhdpi is 2x dimensinons of mdpi
generally, I design mdpi images for a 320x480 screen and then multiply the dimensions as per the above rules to get images for other resolutions.
Android will automatically select the best combination of layout and image depending on the device. For example, for a high resolution medium size device, layout-medium and high density image will be displayed to the user.
Make sure you create emulators for all these combinations and test your app thoroughly. here's the official docs for more info:
https://developer.android.com/guide/practices/screens_support.html
For units of measurement, you can use density independent pixels (dp or dip) which will maintain your relative heights, distances etc across multiple resolutions in a stable fashion.

Terrain tile scale in case of tilted camera

I am working on 3d terrain visualization tool right now. Surface is logically covered with square tiles. This tiling could be visualized as follows:
Suppose I want to draw a picture on these tiles. The level of detail for a picture is required to be selected according to the current camera scale which is calculated for each tile individually.
In case of vertical camera (no tilt, i.e. camera looks perpendicularly on the ground) all tiles have the same scale which is camera focal length divided on camera height above the ground.
Following picture depicts the situation:
where red triangle is camera which has no tilt, BG is camera height above the ground and EG is focal length, then scale = AC/DF = BG/EG
But if camera has tilt (i.e. pitch angle isn't 0) then scale is changed from tile to tile (even from point to point).
So I wonder if there any kind method to produce reasonable scale for each tile in that case ?
There may be (there almost surely is) a more straightforward solution, but what you could do is regular world to screen coordinate conversion.
You just take the coordinates of bounding points of the tile and calculate to which pixels on the screen these will project (you of course get floating point precision). From this, I believe you can calculate the "scale" you are mentioning.
This is applicable to any point or set of points in the world space.
Here is tutorial on how to do this "by hand".
If you are rendering the tiles with OpenGL or DirectX, you can do this much easier.

"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