Skip to content

Commit

Permalink
AR Hello World IOS SETUP
Browse files Browse the repository at this point in the history
  • Loading branch information
EinarLop committed Mar 21, 2023
1 parent 085958b commit 052a460
Show file tree
Hide file tree
Showing 4 changed files with 333 additions and 284 deletions.
31 changes: 20 additions & 11 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,39 @@ import {
ViroARScene,
ViroText,
ViroARSceneNavigator,
ViroTrackingStateConstants,
ViroBox,
} from '@viro-community/react-viro';

import '@viro-community/react-viro/dist/components/ViroConstants.d.ts';

const HelloWorldSceneAR = () => {
const [text, setText] = useState('Initializing AR...');

function onInitialized(state, reason) {
// console.log('guncelleme', state, reason);
// if (state === ViroConstants.TRACKING_NORMAL) {
setText('Hello World!');
console.log(TRACKING_NORMAL);
// } else if (state === ViroConstants.TRACKING_NONE) {
// // Handle loss of tracking
// }
console.log('guncelleme', state, reason);
if (state === ViroTrackingStateConstants.TRACKING_NORMAL) {
setText('Hello Popop');
console.log();
} else if (state === ViroTrackingStateConstants.TRACKING_NONE) {
// Handle loss of tracking
}
}

return (
<ViroARScene onTrackingUpdated={onInitialized}>
<ViroText
{/* <ViroText
text={text}
scale={[0.5, 0.5, 0.5]}
scale={[1, 1, 1]}
position={[0, 0, -1]}
style={styles.helloWorldTextStyle}
/> */}
<ViroBox
position={[0, 0, -2]}
dragPlane={{
planeNormal: [0, 0, 0],
planePoint: [0, 0, -2],
maxDistance: 10,
}}
onDrag={event => console.log('Drag Event:', event)}
/>
</ViroARScene>
);
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ Aplicación móvil AR para visualizar información asociada a QR's en forma de e

## Instrucciones para correr:

1. kill -9 $(lsof -ti:8081)
2. npx react-native start
1. git clone https://github.com/EinarLop/TechPeopleAR.git
2. kill -9 $(lsof -ti:8081)
3. npm install --legacy-peer-deps
4. npx pod-install (iOS)
5. npx react-native run-ios
Loading

0 comments on commit 052a460

Please sign in to comment.