RSS

Tag Archives: Full Screen

Unity3D webcam rendering: incorrect rotation and flip using WebCamTexture


When rendering webcam as textures, Unity3D ships with a useful WebCamTexture class, the typical use of this class is as follows:

  • Create a GUITexture object: in unity menu:  GameObject  arrow, dash, right icon  Create Other  arrow, dash, right icon  GUI Texture, let’s name it CamTexture;
  • Create a C# script, let’s also name it CamTexture.cs
  • In the script, create an instance of WebCamTexture:

    WebCamTexture webcamTexture;

  • In the Start() function, add below code:

    webcamTexture = new WebCamTexture();               
    guiTexture.texture = webcamTexture;       
    webcamTexture.Play();

image
Wrongly oriented CAM View
   

image
Actual physical view

Advertisements
 
3 Comments

Posted by on November 4, 2013 in Programming, Unity 3d

 

Tags: , , , , , , , , , ,

C++: Show Full Screen Images in a UI (Part II: Using Openframework)


One of my colleague recommended me using Openframework to implement the program to show a full screen image. See more details in this previous blog.

So I first created an application class FullScreenApp, which derives from ofBaseApp:

image 

An ofImage object is then introduced, and the update() and draw() function is overriden:

image

In the main() function, call the below code:

image

Here the code to load background image and process command line argument is skipped since it is fairly simple and straightforward.

Build and Run! Happy coding!

 
Leave a comment

Posted by on June 6, 2012 in Programming

 

Tags: , , , , ,

C++: Show Full Screen Images in a UI (Part I: Using Nokia Qt)


I was asked to develop a mini-application: just to show a single full screen image to hide some ugly console output. The application supports a command line: FullScreen.exe SomeImage. 

image

 

 

 

 

The first approach came to my mind is MFC, but it is not as easy as expected, and I come to hate MFC after I know Qt and other frameworks. Yes for sure, you can use SetWindowPos() etc. or other Windows APIs like that… But I would like to try some alternative solutions here.

I decided to try Qt first, and see how easy/difficult it is. I admit that I have no rich experience in Nokia Qt, but it turns out it is not as hard as imagined.

image

image

image

image

  • Delete the menuBar, mainToolbar and statusBar, as we do not need them.
  • Drag a label control to the form.

image

  • Change the label’s pixmap property and select an image from hard disk.
  • Tick the scaledContents checkBox.

image

Build (Ctrl + B) and Run (Ctrl + R), and the Qt program should like this:

image

Next, show this mainform in full screen mode. This can be easily done in main.cpp, by changing show() to showFullScreen():

image

Lastly, make the label stretch fit the canvas. Right click the canvas (inside the form, but outside the label image control), and select “Lay out” –> Lay Out in a Grid (Ctrl + G) to accomplish this.

image

It is almost done. But one can notice the margin between the lable/image and the frame

image

Select the centralWidget, set all the layout margin from “9” to “0”.

image

Build (Ctrl + B) and Run (Ctrl + R), and the full screen Qt program is done.

 
1 Comment

Posted by on June 6, 2012 in Programming

 

Tags: , , ,