Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Meta Quest 3 #301

Open
sujathasperi2022 opened this issue Jul 9, 2024 · 0 comments
Open

Support for Meta Quest 3 #301

sujathasperi2022 opened this issue Jul 9, 2024 · 0 comments

Comments

@sujathasperi2022
Copy link

sujathasperi2022 commented Jul 9, 2024

Am developing an app for Meta Quest 3 using viro.

Below is the code I tried.

import {
  ViroARScene,
  ViroARSceneNavigator,
  ViroScene,
  ViroText,
  ViroTrackingReason,
  ViroTrackingStateConstants,
  ViroVRSceneNavigator,
} from "@reactvision/react-viro";
import React, { useState } from "react";
import { StyleSheet } from "react-native";

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

  function onInitialized(state: any, reason: ViroTrackingReason) {
    console.log("onInitialized", state, reason);
    if (state === ViroTrackingStateConstants.TRACKING_NORMAL) {
      setText("Hello World!");
    } else if (state === ViroTrackingStateConstants.TRACKING_UNAVAILABLE) {
      // Handle loss of tracking
    }
  }

  return (
    <ViroARScene onTrackingUpdated={onInitialized}>
      <ViroText
        text={text}
        scale={[0.5, 0.5, 0.5]}
        position={[0, 0, -1]}
        style={styles.helloWorldTextStyle}
      />
    </ViroARScene>
  );
};

export default () => {
  return (
    <ViroARSceneNavigator
      autofocus={true}
      initialScene={{
        scene: HelloWorldSceneAR,
      }}
      style={styles.f1}
    />
  );
};

var styles = StyleSheet.create({
  f1: { flex: 1 },
  helloWorldTextStyle: {
    fontFamily: "Arial",
    fontSize: 30,
    color: "#ffffff",
    textAlignVertical: "center",
    textAlign: "center",
  },
});

This is how it looks in android phone

imgpsh_fullsize_anim

When I run in MQ3

com oculus shellenv-20240709-221344

UPDATE 10 Jul 2024 12.31 PM

the on initialized function return as

onInitialized 1 1

state is 1 which means ViroTrackingStateConstants.TRACKING_UNAVAILABLE
reaon is 1 which means ViroARTrackingReasonConstants.TRACKING_REASON_NONE

state value one means AR Camera position is not available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant