UX Collective

We believe designers are thinkers as much as they are makers. https://linktr.ee/uxc

Follow publication

Member-only story

Easy-To-Follow Tutorials

Make your React websites fun by adding interactive 3D objects

A simple tutorial on using React-Three-Fiber with React.

Ran (Reine)
UX Collective
Published in
5 min readJun 6, 2021

A header image from Unsplash — shows a pineapple with balloons
Photo by Pineapple Supply Co. on Unsplash

I love fun websites. ʕ•́ᴥ•̀ʔっ♡

When there are some cool effects that add in some element of surprise and interactivity, I always get a little surge of delight when I scroll through it.

Even though vanilla CSS and JavaScript can go a looong way towards creating awesome experiences for your users (see link), today we’re going to be looking at how we can render 3D objects in your browser with React-Three-Fiber.

Here’s the end product:

This image shows a gif of a donut when one interacts with it by dragging it around with a mouse. It changes colours between green and pink too when you click on the icing of the donut.
Screencast by Author

In today’s tutorial, we’re going to go through how to render a glTF and a GLB object (they’re slightly different) in your React app. Some of the differences between a glTF file and a GLB file are:

+---------------------------------+--------------------------------+
| glTF | GLB |
+---------------------------------+--------------------------------+
| JSON based file | Binary format…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Written by Ran (Reine)

I live for days when I can watch skies of blue, while enjoying the view. Most other days I’m a city rat who scuttles between Art and Coding. SG NTU CS Grad.

Responses (2)

Write a response

Great read! Blender have recently added glTF embedded, which offers the best of both worlds of GLB and glTF. You should check it out!

--

,,

--