Giter Site home page Giter Site logo

lastcode802 / threedview Goto Github PK

View Code? Open in Web Editor NEW
5.0 0.0 2.0 15.9 MB

This library or package is all about rendering your 3D models in way, So you can manage or get preview of your 3D models and play with them. The model loading speed in the browser depends on the user's internet speed.

Home Page: https://www.npmjs.com/package/@lastcode802/threedview

JavaScript 4.95% HTML 11.92% TypeScript 78.08% CSS 5.05%
3d-models 3drendering canvas javascript nextjs reactjs rendering storybook threejs typescript

threedview's Introduction

MUI logo

lastcode802

MUI logo

Lastcode802 Present 3d Model View

This library render a 3d model View on React.js and Next.js

Description

This library or package is all about rendering your 3D models in way, So you can manage or get preview of your 3D models and play with them. The model loading speed in the browser depends on the user's internet speed.

Available Code

import * as React from 'react';
import { ThreedView } from "@lastcode802/threedview";

function App() {
  return (
    <ThreedView
      model3dmtl="./assets/IronMan/IronMan.mtl"
      model3dobj="./assets/IronMan/IronMan.obj"
      near={0.1}
      positionx3d={0}
      positiony3d={5}
      positionz3d={20}
      meshpositionx={0}
      meshpositiony={3}
      meshpositionz={0}
      rotationx={0.0}
      rotationy={0.01}
      rotationz={0.0}
      scalex={0.02}
      scaley={0.02}
      scalez={0.02}
      threedviewcanvascolor="#263238"
      directionallightcolor={0xffffff}
      directionallightintensity={1.8}
    />
  );
}

export default App;

In the interactive demo below, try changing the props and see how it affects the storybook output.

Download default 3d model use in library.

Document

Props

prop type default example
model3dmtl* string ./assets/IronMan/IronMan.mtl assests must be in the public folder
model3dobj* string ./assets/IronMan/IronMan.obj assests must be in the public folder
near* number 0.1 0.1-(-10)-1000
positionx3d* number 3 350-(-800000)
positiony3d* number 5 30-(-800000)
positionz3d* number 20 20-(-800000)
meshpositionx* number 0 0
meshpositiony* number 3 0
meshpositionz* number 0 0
rotationx* number 0 0-0.001
rotationy* number 0.01 0-0.01
rotationz* number 0 0-0.001
scalex* number 0 (0.1-0.9,0.01-0.0.9,0.0001-0.0009)
scaley* number 0.02 (0.1-0.9,0.01-0.0.9,0.0001-0.0009)
scalez* number 0.02 (0.1-0.9,0.01-0.0.9,0.0001-0.0009)
threedviewcanvascolor* THREE.ColorRepresentation white Accepts hash vale,rgb and name of the color
directionallightcolor* number 16777215 Accepts hash vale,rgb and name of the color
directionallightintensity* number 1.8 0-255
loaderColor* string red Accepts hash vale,rgb and name of the color
showLoader* bool true true-false

Special Mentions for Contributors


Find & contact me

LinkedIn Gmail Discord Discord Github

threedview's People

Contributors

nadirdeveloper avatar sahilnenwani avatar sharozraees802 avatar wasi-mahmood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Forkers

wasi-mahmood

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.