I am interested in building virtual reality applications and I am at beginner level.
I imported a FBX file of Airplane and imported it in Unity,
Upon linking the animation in Unity and building it onto my Mobile, I see a 2D version of the model. How should I convert it into virtual reality application.
Below is a snalshot of the file. The aiation is also fairly simple, one plane takes off and flies for sometime before landing.
Below is a snapshot of the Game Console
So inshort the question is how do I convert this into a 3D mode so that I can use it as a virtual reality Application.
Thank you
That is 3D mode.
Making a VR application isn't done at the push of a button
Start here:
Read about VR in unity
It seems like you are a new Unity user. If so do this first:
Depending on what you want to do in your application you should look into the Unity Documentation and read about:
Basics
Cameras
Creating Gameplay
Animation
If you at some point feel you don't understand these links, you may need to take another step back and start off by checking out the official tutorials
Just save your .blend file in the Unity's Assets folder.
Look at the documentation for more informations
Related
So for context, I'm using AR core in Unity to build an augmented reality experience for my job. I've made a version of this using adobe Aero and I'm using unity in order to get it available for use with Android. Anyway, how I've been switching between scenes in aero is through use of a flat, PNG button that says next scene, making everything disappear and the next scene appear. So far, in unity, I haven't gotten the PNG's to import into the scene.
I've been doing research and I loosely know that in a 3D space a flat image becomes a 'sprite' but I'm not sure if I'm importing it incorrectly or using the wrong format, and so far all the resources I consulted only talks about sprites in a 2D setup. not 3D or AR as I am. Any ideas or suggestions are welcome.
I've started learning gaming development using Unity and there's a thing I wasn't able to fully understand. I stumbled across the Sketch Fab website and noticed this cool market with 3D models and I was wondering what are the requirements to import such a model into an actual game.
For example this one already has animations:
https://sketchfab.com/3d-models/royal-knight-895d1c1d222d4efd9f264318e8ab0cb2
But on the other hand others don't have:
https://sketchfab.com/3d-models/crusader-knight-b079a8e34f454836bc8107c21c8c47fe
I have basically 2 questions:
If I buy the first model is this going to save me a lot of time and I can jump straight into implementing the character into an actual game and add custom scripts to it etc?
If I buy the second one, what would I need to too to actually animate this character? Is this something that somehow I can learn from Unity tutorials or would I need to import it to a tool like Blender to further improve this model with animations?
This question provokes a lot of answers. The first model you show does have a .fbx format and the animations will hopefully work fine. This format is typically what you want to use with Unity.
The second model is not Rigged (look at the product description). What this means is you will have to rig every bone yourself (in Blender) and make it compatible with Unity. I never buy a model that isn't rigged.
To add animations to the second character, you can download some from www.mixamo.com or use many of the animations you will find in the Unity Asset Store.
Personally, I prefer getting my models from www.turbosquid.com. You can search against multiple formats including .unitypackage
As Jiveturkey said, the first model is directly compatible with unity and doesn't require any additional steps - so if you're looking to focus solely on building the game without worrying about animation then you might want to go with the first model.
The second model isn't rigged, so you would have to manage all rigging and animating yourself - Unity does have a built-in rigging package, so you would be able to do that within unity rather than using Blender (Link to tutorial for rigging in Unity, Rigging tutorial directly from unity)
Unity can read .fbx, .dae (Collada), .3ds, .dxf, .obj, and .skp files for 3D models, and that's pretty much the only requirement. There are tons of sites with free 3D assets if you don't want to spend the money as well Itch.io, Unity Asset Store, and tons more - these are just the ones that come to mind
I am making a first-person game using Unity and Vuforia. What I'm trying to achieve is that the user can have a marker attached on an object that can be held in his hand (a bottle, a book, or toy). So when he plays the game, he can hold the object in his hand, have the object facing the webcam, and move or rotate the object to control the first person character in Unity, e.g., tilt the marker-attached bottle in physical world so the first person character moves forward in Unity's virtual world. ps. by virtual world I mean just a basic first-person character walking around in a room, not the kind of VR that involves Oculus Rift.
I just played around with Vuforia. The good thing is I can choose my own image as the marker (looks like not every marker-based Unity plug-in can do this). But with Vuforia, can I create a virtual environment that's not showing the webcam's view? I did a basic Vuforia + Unity tutorial that only shows what the webcam captures and overlays a virtual cube on the detected marker. Summary of what I need is: not showing the webcam's view but still have the webcam functioning that it can capture the marker and I can use its position/rotation. In a way you can say I am just using the marker+webcam combo as a sensor used to control my virtual world activity.
Thanks!
From what I get it appears you want to use your marker as a target object to control motion in AR..
You'll have to build the functionality in Unity only as to what you want it to do specifically according to your set gameplay..
For example if you want a virtual dog to follow a target object, one easy way to do it is to provide an offset between the marker and the game Object and play a walking/running animation.
So it will appear as if the object is always following the marker, whereas in reality it is playing same animation at a constant distance.
As far as importing the marker is concerned.. It is no different than what you must have done with your cube..
In your Vuforia account Dev Portal:
Download the Vuforia SDK and import in your Unity asset folder.
Go to Liscense Manager under Develop tab and add a Liscense Key.
Now go to the Target Manager and add your images in the Databse which you want as target. (make sure the image quality is good for it to work prperly)
Now download the database and import it in your Assets folder in Unity.
Now go to your Liscense Manager again and copy your Liscense key and Open Vuforia Configuration under Vuforia Behaviour (Script) when you click on AR Camera, you'll find a dialog box there, paste this key there.
Save the build and run your game in Unity and bring the marker in front of the Webcam and it should work properly.
Hope this helps.
I just downloaded Google Cardboard SDK for unity. I am fine and able to create VR project. Setup is fine and everything is working fine.
I am noob at VR Apps. Just stepped in VR Apps.
I am planing to create my own VR Enabled Video Player for android, Just like the default Google Cardboard Youtube player.
Can any one suggest me a link or can guide me in developing this app.
Scott Driscoll's answer totally works. I had some initial problems getting the Easy Movie Texture Unity plug-in to work for me, but finally figured it out, and it works flawlessly. I now have 360-video running as a texture on the inside of a sphere on my iPhone 6. And I have to say, I didn't think it would happen.
For working on a Mac, here's what I did:
Download the Easy Movie Texture plug-in from the Unity Asset Store
Open the Demo Sphere demo scene from Assets/EasyMovieTexture/Scene
Create a new (empty) Prefab to your project, and drag the Sphere GameObject from the Demo Sphere scene onto the Prefab.
Reopen your Cardboard scene and drag the new videosphere prefab into your hierarchy.
Open your source 360-video in Quicktime
File -> Export -> 720p
Change file extension from '.mov' to '.mp4'
Drag your new mp4 file into your projects Assets/Streaming Assets directory. Note: don't import through the menu system, as this will force Unity to convert to OGG.
On the "Media Player Ctrl" script component of your videosphere GameObject, locate the "Str_File_Name" field and provide the FULL filename. Make sure to include the extension as part of the string, "mymovie.mp4".
Pretty sure that's everything. Hope it helps other folks stuck on this problem. Thanks Scott Driscoll!
One last note, you can only view the video on the phone, not in preview in the editor. It would be better if it didn't work this way, but really once the initial issues of resolution and placement are resolved, I don't really need to see the video every time I run the scene in the editor.
Here are the major steps for how we do this:
Add a sphere with an equirectangular UV mapping and inward facing normals around the camera.
Purchase a plugin to play a movie on that sphere’s texture. I recommend Easy Movie Texture.
Use mp4s or ogg vorbis files that are compatible with the platform. This is phone and OS dependent.
Full details: http://immersivetechblog.foundry45.com/2015/07/31/implementing-360-video-in-unity-for-gear-vr-and-cardboard/
I saw the answers above but all of them either required Easy Movie Texture Unity plug-in or coding your way through..
There's another easy solution to this as well which won't require you to buy that asset or code your way through..
Oculus provides an already built free sample framework which you can use without much trouble..
The solution below shows both how to create both a photo viewer as well as video viewer for Unity..
Building your 360 degree PhotoViewer:
Go to Blender and delete all the prexisitng objects (if any) and make an icosphere and increase the subdivisions to a point where it looks more like a sphere like 6 and hit Generate UVs (both these options are found in settings underneath the create tab in add to sphere) and go to edit and choose Flip Normals so that you can see inside out rather than outside inwards and save it.
Bring that icosphere saved file into your assets folder in Unity.
Download GoogleVR SDK and bring GoogleVR plugin into your assets folder as well.. (You can download it here: https://developers.google.com/vr/unity/)
Delete the main camera and directional light present in default.
Bring your icosphere asset into your project.
Bring GVR Main from your assets folder into your project: GoogleVR plugin -> Legacy -> Prefab -> GVR Main
Take any panaroma or 360 photo and bring it in your assets folder.
Take this photo in your asset folder and put it above the icosphere in your scene and hit play. You should be able to see your 360 degree photos.
Building your 360 degree MoviePlayer:
Step 1 same.
Now go to the Oculus developer console and download this file and bring this to your assets folder. https://developer3.oculus.com/downloads/game-engines/1.5.0/Oculus_Sample_Framework_for_Unity_5_Project/
Bring this file you downloaded above to your assets folder.
Find MoviePlayer in your assetsFolder in bring it in your project.
Bring the icosphere you downloaded into your assets folder as well and scale it a little bit so you can see correctly.
Copy the MoviePlayer sample script and Audio Source in the components of the MovieSurface from the project and add it in the components of the sphere in the scene, also get rid of the animator in the components of the sphere.
Bring the Movie Player material found in the Materials under Mesh Renderer in MovieSurface and add it on top of your sphere.
Now this sphere formed is your 360 degree movie player so store it as an asset in the asset folder.
Create a new scene, delete the directional light and bring your saved icosphere asset into this scene and move the main camera at the centre.
Delete the non required assets to clean up some space in your project other than MoviePlayer, Plugins and Streaming Assets.
You'll have to convert the desired mp4 into an ogv file as well for the plugin to play in VR and bring both the mp4 and ogv files into your streaming assets folder and change the MovieName and click Play. You should be able to see your 360 degree video playing.
*To play it in your devices, just go to build settings and choose the desired platform and delete all the scene and just Add Open Scene and click on the Virtual Reality Supported in Other Settings under Player Settings.
To play it in your android phone you need to download the GoogleVR SDK just like above and bring it in your assets folder and find the GVRViewerMain in the assets folder and bring it in the scene and uncheck the Virtual Reality Supported you did above and just build and run the whole thing in your device (You should be able to see the view in you game mode when you hit play in Unity).
You should be able to see the video in your respective gear.
There's also a video tutorial available but I'm only able to share only 2 links with my new StackOverFlow profile.
I can't help you with Unity, but in java, you can create a texture with OpenGL-ES:
private static int GL_TEXTURE_EXTERNAL_OES = 0x8D65;
....
GLES20.glGenTextures(1, textureHandle, 0);
GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureHandle[0]);
Use it to create a surface texture and a surface:
SurfaceTexture surfaceTexture = new SurfaceTexture(textureHandle[0]);
Surface surface = new Surface(surfaceTexture);
And then pass that surface to android.media.MediaPlayer:
MediaPlayer mediaPlayer = new MediaPlayer(getContext(), uriToMyMediaFile, surface);
Bind that texture to a square in your scene and call this every frame:
surfaceTexture.updateTexImage()
and the video will play when you call mediaPlayer.start();
If Unity allows you to write your own java code to run behind the scenes, this should work if you bind that texture to a surface from Unity.
If you have a video stream that you can't play with mediaPlayer (like a live video chat, etc), you can use the surface with android.media.MediaCodec as well, but there's a lot more setup work involved.
This has become very simple for Unity 5.6 and above.
You just need a sphere with its normals inverted which you can either find online or just go to blender and make an IcoSphere and flip its normals or you can use a shader to do the same on a normal sphere. In either case use an Unlit texture for the shader.
Add a Video Player in the component which comes default with Unity to this sphere.
Add any 360 degree video to this Video Player. You can also add an online link as well. And it plays consistently well throughout the range of platforms from GoogleVR to SteamVR.
The only downside is, it only plays monoscopic images/videos by default and there requires some tweaking to run stereoscopic images/videos.
I am currently developing a 2d game for android using Unity3d , but i am wondering if is there any free sprite sheet creator software that is compatible with unity3d without the extra code to be written , i've tried texture packer with there plugin for unity and it work great but this software is paid and i can not afford it right now ,
i also tried Sprite Sheet Packer but when i import the sprite sheet into unity and trim the sprites in the editor the animation does not work properly due to the fact that unity did not know the pivot point and the exact information of the sprite inside the created sprite sheet,
Does anyone know some useful free software that i can use or some unity plugin that can serve this problem ?
I personally always used TexturePacker (then when I moved to Unity, NGUI does the work for me), so this is a recommendation from a friend:
http://renderhjs.net/shoebox/
A quick test showed that it made a PNG and accompanying XML file with the image data inside. Seems pretty simple.
This question still actual in 2017. So this is my approach:
1) Get xml file with coordinates from your editor. I use DarkFunction sprite editor for fast and smart creation of coordinates. It's free and pretty clever to do lots of jobs automatically.
2) Install this asset from asset store, it's free.
3) Tweak the TextureAtlasSlicer.cs file from the installed asset to correspond to your xml format. You have to do this only once.
That's it.