A apresentação está carregando. Por favor, espere

A apresentação está carregando. Por favor, espere

Realidade Aumentada e Unity3D

Apresentações semelhantes


Apresentação em tema: "Realidade Aumentada e Unity3D"— Transcrição da apresentação:

1 Realidade Aumentada e Unity3D
Allan Oliveira

2 Começando...(veja a apresentacao em tela cheia)
Abram a Unity3D Criem um projeto novo Importem o Vuforia 3.0 para o novo projeto vuforia-unity-android-ios unitypackage Caso não tenha procure por Unity Extension - Vuforia v3.0, cadastre no site e faça o download Baixem projetos conceitos para olharmos se sobrar tempo

3 Vamos criar nossos próprios marcadores?
Acessem o site Registre-se caso ainda não tenha feito Clique no menu superior “Target Manager” Criem um novo Database Add new Target

4 Meu modelo de Target

5 Criando os próprios marcadores
No gerenciador de Targets, é possivel explorar cada Target criado e ver quao rastreavel ele é em estrelas de 1 a 5 O site tmb da dicas de como melhorar o seu marcador ou que tipo de marcador criar, e na opcao Show Features é possivel ver o seu Target pelo algoritmo de reconhecimento de padroes do Vuforia

6 Hora de começar a diversão!
Com o Target criado... Baixe o Target para seu computador, e importe ele no projeto da Unity Hora de começar a diversão!

7 Revisao rapida de Unity
Interface da Unity Oque é um Transform? Oque é um Gameobject? Oque é uma Camera? Começando: Delete a Main Camera na cena Coloque na cena o Prefab ARCamera Path: Qualcomm Augmented Reality\Prefabs\ARCamera Do manual: “The ARCamera is responsible for rendering the camera image in the background and manipulating scene objects to react to tracking data”

8 Configurando a Webcam do PC
Como o tempo é curto, vamos fazer os testes no PC. Porem o plugin foi feito para Android e iOS

9 Configurando o marcador (Target)

10 Criando um simples objeto 3D para ser renderizado
Crie um cubo Coloque ele como filho do ImageTarget Ajuste sua posição e tamanho

11 O gerenciador de rastreamento: TrackableEventHandler
The Default Trackable Event Handler (DefaultTrackableEventHandler) is a script component of the Image Target that causes the cube you just drew to appear or disappear automatically – an automatic reaction to the appearance of the target in the video. You can override this default behavior – one could also imagine playing a fade-out animation, showing an info screen or playing a sound for example. For a more detailed description of the ITrackableEventHandlerinterface, please see  'Responding to Tracking Events' in here:

12 Se tivermos tempo... Vamos criar botões virtuais!!!
Importe o projeto VirtualButtons Abre a cena Vuforia-VirtualButtons Path: Qualcomm Augmented Reality\Scenes\Vuforia-VirtualButtons

13 Fazer as trocas necessárias para usar o marcador de escolha
Ou somente salve a imagem do marcador desse projeto no seu celular e mostra para a câmera. \Editor\QCAR\ImageTargetTextures\StonesAndWood\wood_scaled

14 Restrições Virtual buttons work only with image targets, and not with frame markers or multi-targets. Virtual buttons need to cover an area of the target that includes detectable features. Create a new virtual button for a given image target at runtime by calling the CreateVirtualButton member function on the corresponding instance of your ImageTargetBehaviour. Note: The position and size arguments are defined in the local image target space. Destroy a virtual button by calling DestroyVirtualButton, which is also defined inImageTargetBehaviour. Note: Because of swappable databases, the database must be deactivated before creating a virtual button.

15 Código de exemplo para criar um botão novo em runtime
// Deactivate the current data set ImageTracker imageTracker = (ImageTracker) TrackerManager.Instance.GetTracker<ImageTracker>(); //Here we assume that the first active data set contains the image target DataSet dataSet = imageTracker, GetActiveDataSets().First(); imageTracker.DeactivateDataSet(myDataSet); // Create a virtual button ImageTargetBehaviour itb = GetComponent<ImageTargetBehaviour>(); VirtualButtonBehaviour vbb = itb.CreateVirtualButton("mybutton", new Vector2(0, 0), new Vector2(0.1f, 0.1f)); // Register an event handler // Here we assume this class extends IVirtualButtonEventHandler vbb.RegisterEventHandler(this); // Reactivate the dataset imageTracker.ActivateDataSet(myDataSet);


Carregar ppt "Realidade Aumentada e Unity3D"

Apresentações semelhantes


Anúncios Google