Difference between revisions of "3D Objects Help"

From RobotX
Jump to navigation Jump to search
m (Text replacement - "<!--T:.*-->" to "")
m (Text replacement - "<tvar|(.*)>" to "")
Line 20: Line 20:
 
=== As Image Handler ===  
 
=== As Image Handler ===  
  
<pre class="wiki">
+
 
 
[[File:Model.json|300x300px|color=,opacity=,...]]
 
[[File:Model.json|300x300px|color=,opacity=,...]]
</pre>
+
 
  
 
=== As Parser function ===
 
=== As Parser function ===
<pre class="wiki">
+
 
 
{{#3d:Model.json}}
 
{{#3d:Model.json}}
 
{{#3d:Model.json|width}}
 
{{#3d:Model.json|width}}
Line 31: Line 31:
 
...
 
...
 
{{#3d:Model.json|width|height|color|opacity|norotate|scale|z|style|class}}
 
{{#3d:Model.json|width|height|color|opacity|norotate|scale|z|style|class}}
</pre>
+
 
  
 
Instead of uploaded filename you can use an url for file located in external site.
 
Instead of uploaded filename you can use an url for file located in external site.
  
 
=== As Parser tag ===
 
=== As Parser tag ===
<pre class="html">
+
 
 
&lt;3d file=&quot;Model.json&quot; width=&quot;&quot; height=&quot;&quot; ... &gt;&lt;/3d&gt;
 
&lt;3d file=&quot;Model.json&quot; width=&quot;&quot; height=&quot;&quot; ... &gt;&lt;/3d&gt;
 
or
 
or
 
&lt;3d width=&quot;&quot; height=&quot;&quot; ... &gt;Model.json&lt;/3d&gt;
 
&lt;3d width=&quot;&quot; height=&quot;&quot; ... &gt;Model.json&lt;/3d&gt;
</pre>
+
 
You also can use url instead of short filename.<br>
+
 
<3d width="100" height="100" norotate="true">Star.stl</3d>
+
 
  
 
== Parameters ==
 
== Parameters ==

Revision as of 15:55, 21 December 2019

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

color=,opacity=,...


As Parser function

Model.json Model.json Model.json ... Model.json


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>



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

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

Hotkeys automatically disables while you edit or submit wiki page.