日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

VR+全景播放器+头控讲解-04

發(fā)布時間:2024/3/26 55 豆豆
生活随笔 收集整理的這篇文章主要介紹了 VR+全景播放器+头控讲解-04 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

VR+全景播放器+頭控講解-01-知識儲備
VR+全景播放器+頭控講解-02-創(chuàng)建球體
VR+全景播放器+頭控講解-03-渲染視頻
VR+全景播放器+頭控講解-04-滑動手勢
VR+全景播放器+頭控講解-05-伸縮畫面
VR+全景播放器+頭控講解-06-頭控實(shí)現(xiàn)
VR+全景播放器+頭控講解-07-分屏技術(shù)

本節(jié)學(xué)習(xí)目標(biāo)

如何實(shí)現(xiàn)通過手勢移動來調(diào)節(jié)呈現(xiàn)出來的畫面位置

實(shí)現(xiàn)步驟

  • 1.單獨(dú)創(chuàng)建一個視圖放在最外層,放手勢對象

    [view addGestureRecognizer:self.panGesture];
  • 2.創(chuàng)建一個滑動手勢

    self.pinchGesture = [[UIPinchGestureRecognizer alloc]initWithTarget:self action:@selector(pinchGesture:)];
  • 3.轉(zhuǎn)換為旋轉(zhuǎn)角度

    if (panGesture.state == UIGestureRecognizerStateBegan){CGPoint currentPoint = [panGesture locationInView:panGesture.view];self.lastPoint_x = currentPoint.x;self.lastPoint_y = currentPoint.y;[self.delegate gestureManager:self panGesture:panGesture matrix4:SCNMatrix4Identity]; }else{CGPoint currentPoint = [panGesture locationInView:panGesture.view];float distX = currentPoint.x - self.lastPoint_x;float distY = currentPoint.y - self.lastPoint_y;self.lastPoint_x = currentPoint.x;self.lastPoint_y = currentPoint.y;// 這里進(jìn)行手勢滑動視角的微調(diào),根據(jù)需求設(shè)置distX *= -0.005;distY *= -0.005;self.fingerRotationY += distX * OSVIEW_CORNER / 100.0;self.fingerRotationX += distY * OSVIEW_CORNER / 100.0;SCNMatrix4 modelMatrix = SCNMatrix4Identity;modelMatrix = SCNMatrix4Rotate(modelMatrix, self.fingerRotationX,1, 0, 0);modelMatrix = SCNMatrix4Rotate(modelMatrix, self.fingerRotationY, 0, 1, 0);
  • 4.改變照相機(jī)的旋轉(zhuǎn)角度

    self.eyeNode.pivot = modelMatrix;

本節(jié)講解完畢
SceneKit 中文教程

總結(jié)

以上是生活随笔為你收集整理的VR+全景播放器+头控讲解-04的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。