ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Augmented Reality Tutorial#5: Scale and drag multiple objects individually.

Автор: Augmented Reality Gaming

Загружено: 2017-03-26

Просмотров: 16205

Описание: In this tutorial, I am going show you how to scale and drag multiple objects individually in Augmented Reality with the touch screen.

Download Scripts: https://drive.google.com/open?id=0B4r...

Please like and subscribe!
Facebook:   / augmentedrealitygaminginfo  

Music: Still Need You.
Link:   / uplink-still-need-you-ncs-release  .
Artists: @itsuplink & @AWR

Scripts:

#Script1: CSharpscaling

using UnityEngine;
using System.Collections;

public class CSharpscaling : MonoBehaviour {


public float initialFingersDistance;
public Vector3 initialScale;
public static Transform ScaleTransform;


void Update (){
int fingersOnScreen = 0;

foreach(Touch touch in Input.touches) {
fingersOnScreen++; //Count fingers (or rather touches) on screen as you iterate through all screen touches.

//You need two fingers on screen to pinch.
if(fingersOnScreen == 2){

//First set the initial distance between fingers so you can compare.
if(touch.phase == TouchPhase.Began){
initialFingersDistance = Vector2.Distance(Input.touches[0].position, Input.touches[1].position);
initialScale = ScaleTransform.localScale;
}
else{
float currentFingersDistance = Vector2.Distance(Input.touches[0].position, Input.touches[1].position);

float scaleFactor = currentFingersDistance / initialFingersDistance;

//transform.localScale = initialScale * scaleFactor;
ScaleTransform.localScale = initialScale * scaleFactor;
}
}
}

#Script2:onClickForScaling

using UnityEngine;
using System.Collections;

public class onClickForScaling : MonoBehaviour {
void OnMouseDown() {
CSharpscaling.ScaleTransform = this.transform;
}
}


#Script3:DragObject1

using UnityEngine;
using System.Collections;

public class DragObject1 : MonoBehaviour {

Vector3 dist;
float posX;
float posY;

void OnMouseDown(){
dist = Camera.main.WorldToScreenPoint(transform.position);
posX = Input.mousePosition.x - dist.x;
posY = Input.mousePosition.y - dist.y;

}

void OnMouseDrag(){
Vector3 curPos =
new Vector3(Input.mousePosition.x - posX,
Input.mousePosition.y - posY, dist.z);

Vector3 worldPos = Camera.main.ScreenToWorldPoint(curPos);
transform.position = worldPos;
}
}

#Script4:Rotate

using UnityEngine;
using System.Collections;

public class Rotate : MonoBehaviour {

// Update is called once per frame
void Update () {
transform.Rotate(0,20*Time.deltaTime,0);
}
}

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Augmented Reality Tutorial#5: Scale and drag multiple objects individually.

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Augmented Reality Tutorial#6: How to select the car in selection menu in Augmented Reality.

Augmented Reality Tutorial#6: How to select the car in selection menu in Augmented Reality.

Иран ударил по ОАЭ, Катару, Бахрейну и Кувейту. Аэропорты закрыты, что будет дальше?

Иран ударил по ОАЭ, Катару, Бахрейну и Кувейту. Аэропорты закрыты, что будет дальше?

Ад на Ближнем Востоке

Ад на Ближнем Востоке

Объявлена ракетная опасность. Заводы и электростанции под ударом. Почему ПВО не справляется?

Объявлена ракетная опасность. Заводы и электростанции под ударом. Почему ПВО не справляется?

Augmented Reality Tutorial series for beginners

Augmented Reality Tutorial series for beginners

Augmented Reality Shapes Combined from Trackers Unity3D Vuforia

Augmented Reality Shapes Combined from Trackers Unity3D Vuforia

Так из чего же состоят электроны? Самые последние данные

Так из чего же состоят электроны? Самые последние данные

Глава страны убит / Экстренное заявление

Глава страны убит / Экстренное заявление

Много лет искал этот станок! Так ли он хорош?

Много лет искал этот станок! Так ли он хорош?

Собрал FLIPPER ZERO за 10$ (Он реально работает!)

Собрал FLIPPER ZERO за 10$ (Он реально работает!)

Augmented Reality Tutorial No. 21: Unity3D and Vuforia for MultiTarget Tracking - YuGiOh! Card Game

Augmented Reality Tutorial No. 21: Unity3D and Vuforia for MultiTarget Tracking - YuGiOh! Card Game

Drag, Rotate & Scale Object 3D Unity AR ( LEAN TOUCH )  - Tutorial Unity AR

Drag, Rotate & Scale Object 3D Unity AR ( LEAN TOUCH ) - Tutorial Unity AR

Vuforia Tutorials

Vuforia Tutorials

ВЫЖИЛ И РАЗВИЛСЯ В ГРОБУ! \ 150 ДНЕЙ

ВЫЖИЛ И РАЗВИЛСЯ В ГРОБУ! \ 150 ДНЕЙ

How to activate animations in AR with touch input using Vuforia AR & Unity3D

How to activate animations in AR with touch input using Vuforia AR & Unity3D

Gestures to Place, Move, Rotate, and Scale Multiple Objects in AR Unity - XR Interaction Toolkit

Gestures to Place, Move, Rotate, and Scale Multiple Objects in AR Unity - XR Interaction Toolkit

Создаём сервер Minecraft за 100 долларов! (2025)

Создаём сервер Minecraft за 100 долларов! (2025)

Augmented Reality Tutorial: How To Change Car Textures and Colors.

Augmented Reality Tutorial: How To Change Car Textures and Colors.

How To Augmented Reality User Defined Target With Unity 2017 | 2018

How To Augmented Reality User Defined Target With Unity 2017 | 2018

Use touch to scale, rotate and drag AR objects | UNITY AR Foundation (ARKit & ARCore) | LeanTween

Use touch to scale, rotate and drag AR objects | UNITY AR Foundation (ARKit & ARCore) | LeanTween

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]