viromedia / viro

ViroReact: AR and VR using React Native
MIT License
2.31k stars 483 forks source link

ViroReact : Multiple Image Marker Recognition not working #284

Closed linuissac closed 6 years ago

linuissac commented 6 years ago

Hello i'm trying to do multiple image marker recognition in ViroReact . The position of augmented card(Image) is not proper. What i'm expecting is after detecting each marker , the card should be in exact position of the marker. The position of 1st augmented card is proper with respect to the marker , on detecting the next marker the 2nd card will be in the same position of 1st one.

`

    <ViroAmbientLight color="#ffffff" intensity={200}/> 

    <ViroARImageMarker target={"poster"} onAnchorFound={this._onAnchorFound} pauseUpdates={this.state.pauseUpdates}>

     <ViroNode position={[0,0,0]} scale={[0,0,0]} rotation={[270,0,0]} dragType="FixedToWorld" onDrag={()=>{}}  animation={{name:"scaleModel", run:this.state.playAnim,}}>

          <ViroImage
           height={0.5}
            width={0.5}
            source={require('./res/black.jpg')} />

    </ViroNode>

    </ViroARImageMarker>

    <ViroARImageMarker target={"poster2"} onAnchorFound={this._onAnchorFound} 
            pauseUpdates={this.state.pauseUpdates}>

    <ViroNode position={[0,0,0]} scale={[0,0,0]} rotation={[270,0,0]}dragType="FixedToWorld" 
          onDrag={() =>{}}
           animation={{name:"scaleModel", run:this.state.playAnim}}>

         <ViroImage 

          height={0.5}

         width={0.5}

      source={require('./res/PEACO.jpg')}/>

       </ViroNode>

    </ViroARImageMarker>
      ........
      ...
      ViroAnimations.registerAnimations({

scaleModel:{properties:{scaleX:0.5,scaleY:0.5, scaleZ: 0.5},

              duration: 1000,
              },
           });`

This is what i'm getting. img_3106 Any help would be really appreciable.Thank you

parideis commented 6 years ago

How does your ViroARTrackingTargets look like? Try changing the orientation of your target.

linuissac commented 6 years ago

No i just solved it by removing animation for the second node. Now it is working perfect. But i don't think its a permanent solution. What do i do if i need animation for all component?I tried by changing the orientation , but no use. I would like to know more about animations.Is there any docs available , other than the one mentioned in viro's official site?

dam00n commented 6 years ago

These are the animation docs we have

Developer Guide -> https://docs.viromedia.com/docs/animation

API Ref -> https://docs.viromedia.com/docs/viroanimations

Each component that is animatable will have an animate prop listed in the respective API ref under optional props.