Skip to content

How to get the position of the Markers? #32

@Zaniyar

Description

@Zaniyar

	const markerRef= useRef<THREE.Group>(null);
	const modelRef= useRef<THREE.Group>(null);                   
             <ARMarker
		  ref={markerRef}
		  params={{ smooth: true }}
		  type={"pattern"}
		  patternUrl={"data/patt.kanji"}
		  onMarkerFound={(x) => {
			console.log(x); // undefined
		  }}
	      >
		  <Model
			  ref={modelRef}
			  scale={[1, 1, 1]}
			  url="/model.glb"
		  />
	  </ARMarker>

later I try to get the position like this:

   modelRef.current.getWorldPosition(new THREE.Vector3()),

it is always 0

Vector3 {x: 0, y: 0, z: 0}
Vector3 {x: 0, y: 0, z: 0}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions