All Projects → Adonis-Stavridis → caroumesh

Adonis-Stavridis / caroumesh

Licence: MIT License
A React component to display 3d models in a carousel-like fashion.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to caroumesh

react-three-arjs
AR.js with react-three-fiber
Stars: ✭ 88 (+39.68%)
Mutual labels:  threejs, react-three-fiber
use-ammojs
ammo.js physics for use with react-three-fiber
Stars: ✭ 16 (-74.6%)
Mutual labels:  threejs, react-three-fiber
three-js-fundamentals-r3f
Examples from the Three.js Fundamentals website recreated in react-three-fiber renderer.
Stars: ✭ 84 (+33.33%)
Mutual labels:  threejs, react-three-fiber
spacesvr
A standardized reality for the future of the 3D Web.
Stars: ✭ 135 (+114.29%)
Mutual labels:  threejs, react-three-fiber
EduSmart
It utilizes 3D, Augmented reality to give real-life simulations or feels of various models and make the learning process more impactful and fascinating. With an interactive live feature, students can ask the teacher their doubts instantly and also discuss.
Stars: ✭ 23 (-63.49%)
Mutual labels:  threejs, react-three-fiber
racing-game-cljs
A 3D racing game built with ClojureScript, React and ThreeJS
Stars: ✭ 209 (+231.75%)
Mutual labels:  threejs, react-three-fiber
bf-3
my personal site, bf.wtf version 3
Stars: ✭ 58 (-7.94%)
Mutual labels:  threejs, react-three-fiber
typefaces
Collection of Google fonts as typeface data for usage with three.js, react-three-fiber, and other tools.
Stars: ✭ 53 (-15.87%)
Mutual labels:  threejs, react-three-fiber
three-loader-3dtiles
This is a Three.js loader module for handling OGC 3D Tiles, created by Cesium. It currently supports the two main formats, Batched 3D Model (b3dm) - based on glTF Point cloud.
Stars: ✭ 179 (+184.13%)
Mutual labels:  threejs
InViewer
A Three.js-based viewer for visualizing OGC IndoorGML data
Stars: ✭ 18 (-71.43%)
Mutual labels:  threejs
FairyGUI-threejs
A GUI Editor & framework for Three.js
Stars: ✭ 115 (+82.54%)
Mutual labels:  threejs
aframe-registry
[DISCONTINUED] Curated collection of community A-Frame components.
Stars: ✭ 76 (+20.63%)
Mutual labels:  threejs
XREngine
Immersive infrastructure for everyone. Everything you need to build and deploy scalable realtime 3D social apps and more. 🤖 🚀 👓 🚀 🕹️ 🚀 🧑🏿‍🚀
Stars: ✭ 423 (+571.43%)
Mutual labels:  threejs
three-laser-pointer
Interactive laser object for VR-like scenes
Stars: ✭ 26 (-58.73%)
Mutual labels:  threejs
THREE.Interactive
Fast and simple interaction manager for three.js for enabling mouse and touch events on 3D objects
Stars: ✭ 49 (-22.22%)
Mutual labels:  threejs
immersive-ar-emulation
A sort-of polyfill to emulate a fake AR environment which can be hit-tested against.
Stars: ✭ 26 (-58.73%)
Mutual labels:  threejs
TweetMigration
A WebGL heatmap of global Twitter activity
Stars: ✭ 42 (-33.33%)
Mutual labels:  threejs
mini-luck-draw
使用 Three.js 开发的一个魔方小游戏....自娱项目
Stars: ✭ 110 (+74.6%)
Mutual labels:  threejs
quantum-face-register
face register with three.js and tracking.js
Stars: ✭ 44 (-30.16%)
Mutual labels:  threejs
gzweb
Web client for Gazebo classic simulation
Stars: ✭ 36 (-42.86%)
Mutual labels:  threejs

Caroumesh

Caroumesh is a React component to display your 3d models in a Carousel-like fashion inside your application, using three.js and react-three-fiber.

Table of contents

Installation

To install Caroumesh execute the following command in your React project:

npm install caroumesh

You can also download it from the Caroumesh npm website.

The package and all of its dependencies should be installed.

Getting started

Import the React components from the package.

import { Caroumesh, Model } from 'caroumesh';

Add them to your render function inside your application.

<Caroumesh>
  <Model src="Star destroyer.gltf" />
</Caroumesh>

You can view a live example and a live demo to better understand how to use this package and what the end result is.

Components

Caroumesh

The Caroumesh component is the parent component that sets up the canvas on which to display the meshes.

<Caroumesh> ... </Caroumesh>

It accepts the following props:

shadows?: boolean; // enable shadows
controls?: boolean; // orbit controls to zoom, rotate and pan around model
radius?: number; // radius of carousel (brings meshes closer / further together)
effects?: boolean; // enables SSAO and HueSaturation (negatively affects FPS)
stats?: boolean; // display FPS (useful for debugging)
animationTime?: number; // transition animation time in ms (1s = 1000ms)
theme?: string; // color theme of controls (left / right arrows)
width?: string; // width CSS property
height?: string; // height CSS property
backgroundColor?: string; // background color
border?: string; // border CSS property
borderRadius?: string; // border-radius CSS property
style?: React.CSSProperties; // any extra CSS properties

The component will take the entire space of the parent by default. Also while developping your application, you can use the stats prop to evaluate performance and see how adding models or lights may affect your FPS.

The Left Arrow and Right Arrow keybinds can be used to rotate to the previous or next model inside the Caroumesh.

If you have set the controls prop, you can use the following keybinds on your mouse and keyboard to control the scene:

Keybind Action
Mouse Left (Hold) Rotate
Shift or Ctrl + Mouse Left (Hold) Pan
Scroll wheel Zoom
Space Reset view

Model

The Model component will load a mesh / model onto the Caroumesh component.

<Caroumesh>
  <Model> ... </Model>
</Caroumesh>

It accepts the following props:

src: string; // source gltf / glb file
shadows?: boolean; // enable shadows on model
offset?: Vector3; // offset model
scale?: number | Vector3; // scale model
rotation?: Vector3; // rotate model

You can add as many models as you like inside of a Caroumesh, just keep in mind that it does affect performance. It is also possible to display a single model, or none at all.

Important: The src prop string should be the relative path to the gltf or glb file of your model. It is recommended you compress your models into glb files with draco compression, to reduce load, with the following command:

npx gltf-pipeline -i model.gltf -o model.glb -d

You can use the offset, scale and rotation props in order to place your model wherever you like.

Important: Use offset prop to offset model instead of position prop. The latter is set by this package and setting it manually may lead to unwanted results.

Lights

The Caroumesh component comes by default with a three point light setup, with casting shadows to illuminate your models. If you want to setup your own light setup you can use the Lights component.

<Caroumesh>
  <Lights> ... </Lights>
</Caroumesh>

Inside of this component you have to add react-three-fiber light components. These are all the possible light components you can use:

<spotLight />
<pointLight />
<rectAreaLight />
<hemisphereLight />
<directionalLight />
<ambientLight />

You can find the documentation of three.js, for more information about what props these components use.

You can add as many lights as you want, though, again, keep in mind more lights leads to heavier load, thus to worse performance.

CaroumeshContainer

The CaroumeshContainer component is useful for catching any errors that could occur when building your application. It is by no means necessary, but can come in handy during development. You can wrap your Caroumesh component with it.

<CaroumeshContainer>
  <Caroumesh> ... </Caroumesh>
</CaroumeshContainer>

It will display what the error that occurred where your Caroumesh should be located inside your app (not inside the console) and possibly the cause and potential fix for that error.

If you are using create-react-app, you don't have to use this component because an integrated error logger is already set up.

Upcoming releases

The next releases would present the following features:

  • Allow importing JSX models
  • Display textual information for each model (title and description)

Links


Thank you for using Caroumesh ! ❤️

// import { Caroumesh, Model } from './index';

// export default { // title: 'Test', // component: Caroumesh, // };

// const CaroumeshTemplate = (args) => { // return (

// ); // };

// export const DefaultCaroumesh = CaroumeshTemplate.bind({});

// export const StyledCaroumesh = CaroumeshTemplate.bind({}); // StyledCaroumesh.args = { // shadows: true, // controls: true, // stats: true, // theme: 'dodgerblue', // };

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].