You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here I want that if I click on a specific gltf model, only that should be able to transform, and if clicked outside my whole scene orbits around as default. But my transformcontrol axes are not coming on model itself, rather coming far away from them.
import * as THREE from 'three'
import React, { Suspense, useState, useRef } from 'react';
import { Canvas, useLoader } from '@react-three/fiber';
import { Html, OrbitControls, TransformControls } from '@react-three/drei';
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
import { DDSLoader } from "three-stdlib";
import { useNavigate } from 'react-router-dom';
THREE.DefaultLoadingManager.addHandler(/.dds$/i, new DDSLoader());
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Here I want that if I click on a specific gltf model, only that should be able to transform, and if clicked outside my whole scene orbits around as default. But my transformcontrol axes are not coming on model itself, rather coming far away from them.
import * as THREE from 'three'
import React, { Suspense, useState, useRef } from 'react';
import { Canvas, useLoader } from '@react-three/fiber';
import { Html, OrbitControls, TransformControls } from '@react-three/drei';
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
import { DDSLoader } from "three-stdlib";
import { useNavigate } from 'react-router-dom';
THREE.DefaultLoadingManager.addHandler(/.dds$/i, new DDSLoader());
const Scene = () => {
const gltf1 = useLoader(GLTFLoader, '/models/sphere.gltf');
const gltf2 = useLoader(GLTFLoader, '/models/cuboid-1.gltf');
const gltf3 = useLoader(GLTFLoader, '/models/cuboid-2.gltf');
const gltf4 = useLoader(GLTFLoader, '/models/cuboid-3.gltf');
};
export default function FreeView() {
}
What is the issue here?
Beta Was this translation helpful? Give feedback.
All reactions