Skip to content

Commit

Permalink
v.1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
foo123 committed Jan 3, 2023
1 parent 44c56db commit c5a3abd
Show file tree
Hide file tree
Showing 86 changed files with 4,183 additions and 1,944 deletions.
62 changes: 31 additions & 31 deletions api-reference.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

### Pivot modifier
### Pivot modifier

Allows to move the pivot point of a 3D mesh.

@author Bartek Drozdz




Expand All @@ -17,122 +17,122 @@ Bends an object along an axis.



### Bloat modifier
### Bloat modifier

Bloats a mesh by forcing vertices out of specified sphere

@author makc




### Twist modifier

### Twist modifier

Twist mesh along an axis
Adapted from the Twist modifier for PV3D




### Skew modifier
### Skew modifier

Skew mesh along an axis

@author Bartek Drozdz




### Taper modifier

### Taper modifier

The taper modifier displaces the vertices on two axes proportionally to their position on the third axis.

@author Bartek Drozdz




### Wheel modifier

### Wheel modifier

Use it with vehicle models for wheels.

The usual problem with a 3d wheel in a vahicle is that it is
supposed to turn (steer) and roll in the same time.
The usual problem with a 3d wheel in a vahicle is that it is
supposed to turn (steer) and roll in the same time.
So, this code:

```javascript
wheel.rotationY = 10; // Steer 10deg to the left
wheel.rotationZ +- 5; // Roll with a speed of 5
wheel.rotationZ += 5; // Roll with a speed of 5
```
This will make the wheel roll incorectly.

A usual way to solve this problem is to put the wheel in another DisplayObject3D/Mesh,
A usual way to solve this problem is to put the wheel in another DisplayObject3D/Mesh,
turn the parent and roll the child, like that:
```javascript
steer.rotationY = 10; // Steer 10deg to the left
steer.wheel.rotationZ +- 5; // Roll with a speed of 5
steer.wheel.rotationZ += 5; // Roll with a speed of 5
```
That will make the wheel behave correctly. But it can be uncomfortanble to apply, especially
to imported complex Collada models.

The Wheel modifier elegantly solves this problem by doind the proper math in order to steer and roll
a single mesh at the same time. The only thing you need to do is to specify a steer vector and
The Wheel modifier elegantly solves this problem by doind the proper math in order to steer and roll
a single mesh at the same time. The only thing you need to do is to specify a steer vector and
roll vector - usually it will be 2 of the cardinal axes. The default value is:

* steer - along the Y axis / new Vector3(0, 1, 0)</li>
* roll - along the Z axis / new Vector3(0, 0, 1)</li>
* steer - along the Y axis / new Vector3(0, 1, 0)
* roll - along the Z axis / new Vector3(0, 0, 1)


It should work with most car models imported from 3D editors as this is the natural position of a wheel.

<i>Please note, that Papervision primitive cylinder, which may also be used as wheel, will require different axes
(Y for roll and Z or X for steer).</i>
*Please note, that Papervision primitive cylinder, which may also be used as wheel, will require different axes
(Y for roll and Z or X for steer).*

@author Bartek Drozdz




### Break modifier
### Break modifier

Allow to break a mesh

@author Bartek Drozdz




### Noise modifier

### Noise modifier

Randomly displaces each vertex in all 3 axes





### DisplaceMap (BitmapDisplacement) Modifier

Displaces vertices based on RGB values of bitmapData pixels.
### DisplaceMap (BitmapDisplacement) Modifier

Displaces vertices based on RGB values of bitmapData pixels.

BitmapDisplacement is inspired by both the AS3 built-in DisplacementMapFilter. It allows
to use color values for each channels of a bitmap to modify the position of vertices in a mesh.

The displacement takes place along the cardinal axes, and each axis is mapped to a
The displacement takes place along the cardinal axes, and each axis is mapped to a
channel in the bitmap: X for Red, Y for Green and Z for Blue.

@author Bartek Drozdz




### Perlin modifier
### Perlin modifier

Displaces vertices based on a perlin/simplex noise source.

Accepts a perlin/simplex noise data (with width and height information) and displaces vertices
based on the value of each point of the noise map.

@author Bartek Drozdz

@uses: https://github.com/josephg/noisejs for JavaScript

52 changes: 18 additions & 34 deletions beeld.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
###################################################

settings ={}
Xpresion = "Xpresion::"
RegExp = "RegExp::"
@

Expand All @@ -21,8 +22,7 @@ tasks =[{}]
build =[{}]

src =[]

!tpl:umd-header-deps.tpl.js # include a umd-header template
./src/header.js

# core
./src/MOD3.js
Expand Down Expand Up @@ -74,21 +74,16 @@ tasks =[{}]
## Support for Pre3D
#./src/plugins/Pre3D/Pre3D.js

!tpl:umd-footer.tpl.js # include a umd-footer template
./src/footer.js

@

# extract header from this file
header = ./src/MOD3.js
header = ./src/header.js

replace =[{}]

"@@ROOT@@" = "this"
"@@MODULE@@" = "MOD3"
"@@DEPS@@" = "Classy"
"@@VERSION@@" = "0.6.0"
"@@USE_STRICT@@" = '"use strict";'

"@@VERSION@@" = "1.0.0"
"@@DATE@@" = Xpresion::date("Y-m-d H:i:s")
@

# extract documentation
Expand All @@ -99,44 +94,33 @@ tasks =[{}]
"output" = "./api-reference.md"
@

out = ./build/mod3.js
@

minify =[{}]

src =[]
./build/mod3.js
@

# Minify the Package (map of lists)
minify ={}

# Options for Node UglifyJS Compiler (if used, default), (mangle and compress)
uglifyjs =[]
-m -c
@

# Options for Java Closure Compiler (if used)
closure =[]
"--language_in=ECMASCRIPT5_STRICT"
@

# Options for Java YUI Compressor Compiler (if used)
yui =[]
--preserve-semi
@

@

out = ./build/mod3.min.js

@


bundle =[{}]

bundle =[]

# bundle-in external dependencies
./build/classy.js
./build/mod3.min.js

@


out = ./build/mod3.bundle.js

out = ./build/mod3.min.js
@

@
6 changes: 3 additions & 3 deletions build-bundle.bat → build-min.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ REM #
REM ###################################################

REM to use the python build tool do:
REM python %BUILDTOOLS%\Beeld.py --config ".\beeld.config" --tasks bundle
REM python %BUILDTOOLS%\Beeld.py --config ".\beeld.config" --tasks minify

REM to use the php build tool do:
REM php -f %BUILDTOOLS%\Beeld.php -- --config=".\beeld.config" --tasks=bundle
REM php -f %BUILDTOOLS%\Beeld.php -- --config=".\beeld.config" --tasks=minify

REM to use the node build tool do:
node %BUILDTOOLS%\Beeld.js --config ".\beeld.config" --tasks bundle
node %BUILDTOOLS%\Beeld.js --config ".\beeld.config" --tasks minify
11 changes: 4 additions & 7 deletions build/MOD3.min.js

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions build/classy.js

This file was deleted.

21 changes: 0 additions & 21 deletions build/mod3.bundle.js

This file was deleted.

Loading

0 comments on commit c5a3abd

Please sign in to comment.