Skip to content

Instantly share code, notes, and snippets.

@JacobMuchow
Forked from dosterz97/AvatarView.js
Created June 27, 2022 20:19
Show Gist options
  • Save JacobMuchow/4023d868386b3ee6c3991d895e435fc5 to your computer and use it in GitHub Desktop.
Save JacobMuchow/4023d868386b3ee6c3991d895e435fc5 to your computer and use it in GitHub Desktop.
import React from 'react';
import * as THREE from "three"
const navigationBarHeight = 100
...
async componentDidMount() {
const mainView = this.mainViewRef.current
this.renderer = new THREE.WebGLRenderer({ antialias: true })
this.renderer.setSize(window.innerWidth, window.innerHeight - navigationBarHeight)
this.renderer.outputEncoding = THREE.sRGBEncoding
this.renderer.toneMapping = THREE.ACESFilmicToneMapping
mainView.appendChild(this.renderer.domElement)
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment