Relative Content

Tag Archive for three.jsreact-three-fiber

Steering around a track in R3F

I am experimenting with threejs and react three fibre. I have a box which I am sending around a track that I made in blender, just some basic planes. I am using two rays one on each side of the box and then rotating the box based on the difference in angle from the hit face normal and the ray.

Unable to export animations along with the cube

import React, { useRef, useEffect, useState } from ‘react’; import { Canvas, useFrame, useThree } from ‘@react-three/fiber’; import { OrbitControls } from ‘@react-three/drei’; import * as THREE from ‘three’; import { GLTFExporter } from ‘three/examples/jsm/exporters/GLTFExporter’; import ‘./App.css’; function Model({ onComplete }) { const meshRef = useRef(); const { scene } = useThree(); const [mixer] = […]

react-three-fiber different textures on front and back of a planeGeometry

I’m attempting to show two different textures on the two sides of a planeGeometry component. It’s possible that I’m misunderstanding how planes work and this isn’t possible, but I thought with the side property I could apply one texture to the front side and one to the back side. With how I currently have it implemented it seems like only the back side texture is rendering.