3D Objects Help

From RobotX
Jump to navigation Jump to search

Description

This wiki includes an extension which allows to add 3D models viewer to site pages.

Supported file extensions

THREE.js model format

  • .json
  • .3djson
  • .3dj * .three

THREE.js model buffer geometry format

  • .buff
  • .buffjson

OBJ file format

  • .obj

STL (binary) file format

  • .stl
  • .stlb

Usage

As Image Handler

[[File:Model.json|300x300px|color=,opacity=,...]]

As Parser function

{{#3d:Model.json}}
{{#3d:Model.json|width}}
{{#3d:Model.json|width|height}}
...
{{#3d:Model.json|width|height|color|opacity|norotate|scale|z|style|class}}

Instead of uploaded filename you can use an url for file located in external site.

As Parser tag

<3d file="Model.json" width="" height="" ... ></3d>
or
<3d width="" height="" ... >Model.json</3d>

You also can use url instead of short filename.

Parameters

Name Description Default value
width Canvas width in pixels 300
height Canvas height in pixels 300
color Model RGB color as hex 0xff00ff
opacity Model opacity as decimal between 0...1 0.8
norotate If true or 1, model does not rotate false
scale Model scale, in percent 100
z Model z coordinate 75
style Additional canvas CSS style
class Additional canvas HTML class

Width and height can be set to 0 value, so size of viewer will be set according to user screen dimensions.

Controls and hotkeys

</translate>

<translate> Action</translate> <translate> Controls</translate>
<translate> Camera rotate</translate> <translate> Swipe, left mouse key hold and move</translate>
<translate> Camera pan</translate> <translate> Right key hold and move</translate>
<translate> Camera zoom</translate> <translate> Mouse wheel, hold wheel and move, pinch</translate>
<translate> Model rotate</translate> <translate> ←↑→↓ keys</translate>
<translate> Model rotation reset</translate> <translate> Home key</translate>
<translate> Model rotation play/pause</translate> <translate> Double click, double tap</translate>
<translate> Model rotation play/pause all models at page</translate> <translate> Enter, Space keys</translate>
<translate> Model rotation speed</translate> <translate> - and + keys</translate>

<translate> Hotkeys automatically disables while you edit or submit wiki page. </translate>