2017-03-08 3 views
9

React VR로 응용 프로그램을 개발 중이며 믹서기로 3D pokeball을 만들었습니다. Wavefront .obj 파일로 내 보낸 후 React VR 응용 프로그램에서 사용합니다.shininess, emissive 및 specular는 React VR에서이 소재의 속성이 아닙니다.

THREE.MeshBasicMaterial : 콘솔에서

나는이 경고가 표시 shininess, emissivespecular이 물질의 속성이 아니다.

당신이 내 코드를 찾을 수 아래 :

import React from 'react'; 
import { AppRegistry, asset, StyleSheet, Pano, Text, View, Mesh } from 'react-vr'; 

class pokemongo extends React.Component { 
    render() { 
    return (
     <View> 
     <Pano source={asset('sky.jpg')} /> 
     <Mesh source={{ mesh: asset('pokeball.obj'), mtl: asset('pokeball.mtl') }} 
       style={{ height: 1 }} 
       transform={{ rotate: '0 90 0' }}></Mesh> 
     </View> 
    ); 
    } 
}; 

AppRegistry.registerComponent('pokemongo',() => pokemongo); 

이 렌더링 된 출력

그리고 this GitHub Gist에 당신이 objmtl 파일을 찾을 수 있고 당신이 다운로드 할 수있다 blend 파일.

블렌더에서 내 pokeball을 볼 수 있습니다. 내가 인터넷에서 검색했지만 관련 문제에 대한 솔루션이나 문서를 발견하지 않았다

는 VR 반응.

내가 잘못 했나요?

답변

6

이것은 Github issue 상태와 같은 react-vr > 0.2.1에서 더 이상 문제가되지 않습니다.

또한 색상 및 음영으로 모델을 렌더링하려면 장면에 조명을 적용해야합니다. 이 작업은 모델에서 lit 소품을 활성화하고 장면에 AmbientLight, SpotLight 또는 DirectionalLight 구성 요소를 사용하여 수행됩니다.

당신이 그것을 만들어 어떻게 볼 수 ModelSample을 확인할 수 있습니다 회전 애니메이션

3d model in vr

import React from "react"; 
import { 
    AppRegistry, 
    asset, 
    Pano, 
    View, 
    Model, 
    AmbientLight, 
    SpotLight 
} from "react-vr"; 

class pokemongo extends React.Component { 
    render() { 
    return (
     <View> 
     <Pano source={asset("chess-world.jpg")} /> 
     <AmbientLight intensity={0.5} /> 
     <SpotLight 
      intensity={1} 
      style={{ transform: [{ translate: [-5, 5, 0] }] }} 
     /> 
     <Model 
      source={{ 
      obj: asset("pokeball.obj"), 
      mtl: asset("pokeball.mtl") 
      }} 
      style={{ 
      layoutOrigin: [0.5, 0.5], 
      transform: [ 
       { translate: [0, 0, -10] } 
      ] 
      }} 
      lit={true} 
     /> 
     </View> 
    ); 
    } 
} 

AppRegistry.registerComponent("pokemongo",() => pokemongo); 
.

관련 문제