我正在玩react-VR框架,似乎無法找到有關在鉻/紙板上進入vr模式的文檔中的任何內容?任何幫助或指針非常讚賞。如何創建react-vr「輸入vr按鈕/紙板」?
3
A
回答
0
這裏是我的代碼的一部分,同時創造一個WebVR旅遊
<View>
<Pano source={asset(this.state.current_scene['scene_image'])} onInput={this.onPanoInput.bind(this)}
onLoad={this.sceneOnLoad} onLoadEnd={this.sceneOnLoadEnd}
style={{ transform: [{translate: [0, 0, 0]}] }}/>
{this.state.current_scene['navigations'].map(function(item,i){
return <Mesh key={i}
style={{
layoutOrigin: [0.5, 0.5],
transform: [{translate: item['translate']},
{rotateX: item['rotation'][0]},
{rotateY: item['rotation'][1]},
{rotateZ: item['rotation'][2]}]
}}
onInput={ e => that.onNavigationClick(item,e)}>
<VrButton
style={{ width: 0.15,
height:0.15,
borderRadius: 50,
justifyContent: 'center',
alignItems: 'center',
borderStyle: 'solid',
borderColor: '#FFFFFF80',
borderWidth: 0.01
}}>
<VrButton
style={{ width: that.state.animationWidth,
height:that.state.animationWidth,
borderRadius: that.state.animationRadius,
backgroundColor: '#FFFFFFD9'
}}>
</VrButton>
</VrButton>
</Mesh>
})}
</View>
onNavigationClick(item,e){
if(e.nativeEvent.inputEvent.eventType === "mousedown" && e.nativeEvent.inputEvent.button === 0){
var new_scene = this.state.scenes.find(i => i['step'] === item.step);
this.setState({current_scene: new_scene});
postMessage({ type: "sceneChanged"})
}
}
sceneOnLoad(){
postMessage({ type: "sceneLoadStart"})
}
sceneOnLoadEnd(){
postMessage({ type: "sceneLoadEnd"})
}
this.sceneOnLoad = this.sceneOnLoad.bind(this);
this.sceneOnLoadEnd = this.sceneOnLoadEnd.bind(this);
this.onNavigationClick = this.onNavigationClick.bind(this);
也許你會發現一些有助於您還here
0
對於桌面版Chrome有標誌:鉻://標誌/ #enable-webvr 啓用Chrome並重新啓動Chrome後,將出現「View in VR」按鈕,但不幸的是,當我單擊它時沒有看到任何更改。 我也嘗試過使用Chromium的實驗開發者版本,但是應該啓用更多的標誌。 很多關於調整瀏覽器的內容在這裏: https://superuser.com/questions/836832/how-can-i-enable-webgl-in-my-browser chrome:// gpu /非常方便檢查您的3D環境,並且不要忘記,在某些情況下(通常在筆記本電腦上),您可以運行瀏覽器視頻卡,而不是強大的GPU,所以resluuts可能是極端不同的。 ,最後你可以檢查node_modules/ovrui/dist/ovrui.js函數tryEnterVR()的源代碼,以更好地理解當你嘗試切換到VR模式時應該發生什麼。
0
像帕維爾索科洛夫說,默認情況下,WebVR未啓用,需要在chrome:// flags部分更新。這將啓用顯示在VR按鈕中。但是,當前版本的Chrome(57)在WebVR中存在問題,可能會導致黑屏。那樣的話,試試Chrome Canary吧,我已經成功地使用了它。
我寫了一本關於如何讓我的紙板與React-VR一起運行的指南,您可以閱讀它here。
相關問題
- 1. 如何使用React VR創建凝視按鈕?
- 2. 如何更改紙板上的角度偏移速度VR
- 3. 在react-vr中沒有進入vr模式按鈕cordova app
- 4. 如何在輸入按鈕周圍創建邊框?
- 5. 如何在ASP.NET 1.1中創建一個輸入按鈕
- 6. 如何檢測React VR場景中的Gear VR輸入?
- 7. 如何創建按鈕?
- 8. 如何創建AppleTV按鈕?
- 9. 如何使用OpenSpace3d創建VR分屏?
- 10. 創建一個按鈕,創建按鈕
- 11. 如何用輸入鍵按下按鈕
- 12. 如何爲按鈕按下時創建兩個輸出?
- 13. 按下插入HTML創建的按鈕
- 14. 自動在aframe中進入vr模式,無需點擊vr按鈕
- 15. 創建按鈕
- 16. 創建按鈕
- 17. 如何在Oracle APEX中創建提交按鈕模板?
- 18. 如何獲得用故事板創建的按鈕的對象
- 19. 如何爲Outlook 2007電子郵件模板創建CSS按鈕?
- 20. 禁用輸入按鍵輸入按鈕
- 21. 如何從紙板
- 22. Unity 3D谷歌紙板(VR)凝視功能沒有EventTrigger
- 23. 更改紙板中的照片VR-360 SDK
- 24. 紙按鈕和圖標紙卡頭
- 25. 如何將按鈕連接到輸入
- 26. 如何將按鈕與輸入組合?
- 27. 如何驗證輸入按鈕?
- 28. 用戶輸入創建按鈕,如何將它們存儲下一次
- 29. 如何基於單選按鈕的輸入創建動態文本字段
- 30. 如何通過Java中的按鈕使用輸入的值創建序列?
我剛剛嘗試用鉻和vr reactvr只閃現場一微秒,然後完全黑色,你說得到鉻金絲雀任何想法爲什麼鉻(57)不起作用? – JRowan