Skip to content

Commit 6f565f4

Browse files
author
Nikos M
committed
v.0.6.0 contd,
* remove 3D plugins from packaged build, include them manualy * factory-pattern modifiers, plus more parameters can be passed during initialisation
1 parent bfc49d3 commit 6f565f4

71 files changed

Lines changed: 324 additions & 314 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api-reference.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -56,38 +56,38 @@ The taper modifier displaces the vertices on two axes proportionally to their po
5656

5757
Use it with vehicle models for wheels.
5858

59-
The usual problem with a 3d wheel in a vahicle is that it is
60-
supposed to turn (steer) and roll in the same time.
61-
So, this code:
62-
63-
```javascript
64-
wheel.rotationY = 10; // Steer 10deg to the left
65-
wheel.rotationZ +- 5; // Roll with a speed of 5
66-
```
67-
This will make the wheel roll incorectly.
68-
69-
A usual way to solve this problem is to put the wheel in another DisplayObject3D/Mesh,
70-
turn the parent and roll the child, like that:
71-
```javascript
72-
steer.rotationY = 10; // Steer 10deg to the left
73-
steer.wheel.rotationZ +- 5; // Roll with a speed of 5
74-
```
75-
That will make the wheel behave correctly. But it can be uncomfortanble to apply, especially
76-
to imported complex Collada models.
77-
78-
The Wheel modifier elegantly solves this problem by doind the proper math in order to steer and roll
79-
a single mesh at the same time. The only thing you need to do is to specify a steer vector and
80-
roll vector - usually it will be 2 of the cardinal axes. The default value is:
81-
82-
* steer - along the Y axis / new Vector3(0, 1, 0)</li>
83-
* roll - along the Z axis / new Vector3(0, 0, 1)</li>
84-
85-
86-
It should work with most car models imported from 3D editors as this is the natural position of a wheel.
87-
88-
<i>Please note, that Papervision primitive cylinder, which may also be used as wheel, will require different axes
89-
(Y for roll and Z or X for steer).</i>
90-
59+
The usual problem with a 3d wheel in a vahicle is that it is
60+
supposed to turn (steer) and roll in the same time.
61+
So, this code:
62+
63+
```javascript
64+
wheel.rotationY = 10; // Steer 10deg to the left
65+
wheel.rotationZ +- 5; // Roll with a speed of 5
66+
```
67+
This will make the wheel roll incorectly.
68+
69+
A usual way to solve this problem is to put the wheel in another DisplayObject3D/Mesh,
70+
turn the parent and roll the child, like that:
71+
```javascript
72+
steer.rotationY = 10; // Steer 10deg to the left
73+
steer.wheel.rotationZ +- 5; // Roll with a speed of 5
74+
```
75+
That will make the wheel behave correctly. But it can be uncomfortanble to apply, especially
76+
to imported complex Collada models.
77+
78+
The Wheel modifier elegantly solves this problem by doind the proper math in order to steer and roll
79+
a single mesh at the same time. The only thing you need to do is to specify a steer vector and
80+
roll vector - usually it will be 2 of the cardinal axes. The default value is:
81+
82+
* steer - along the Y axis / new Vector3(0, 1, 0)</li>
83+
* roll - along the Z axis / new Vector3(0, 0, 1)</li>
84+
85+
86+
It should work with most car models imported from 3D editors as this is the natural position of a wheel.
87+
88+
<i>Please note, that Papervision primitive cylinder, which may also be used as wheel, will require different axes
89+
(Y for roll and Z or X for steer).</i>
90+
9191
@author Bartek Drozdz
9292

9393

beeld.config

Lines changed: 20 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,26 @@ tasks =[{}]
5353
./src/modifiers/DisplaceMap.js
5454
./src/modifiers/Perlin.js
5555

56-
# Support for Three.js
57-
./src/plugins/Three/Three.js
58-
59-
# Support for OSG.js
60-
./src/plugins/OSG/OSG.js
61-
62-
# Support for J3D
63-
./src/plugins/J3D/J3D.js
64-
65-
# Support for CubicVR.js
66-
./src/plugins/CubicVR/CubicVR.js
67-
68-
# Support for Copperlicht
69-
./src/plugins/Copperlicht/Copperlicht.js
70-
71-
# Support for Pre3D
72-
./src/plugins/Pre3D/Pre3D.js
56+
## IMPORTANT: Include the appropriate plugin in your application manualy (it is just one file)
57+
## to avoid overloading the packaged code, the plugins are removed from the build
58+
59+
## Support for Three.js
60+
#./src/plugins/Three/Three.js
61+
#
62+
## Support for OSG.js
63+
#./src/plugins/OSG/OSG.js
64+
#
65+
## Support for J3D
66+
#./src/plugins/J3D/J3D.js
67+
#
68+
## Support for CubicVR.js
69+
#./src/plugins/CubicVR/CubicVR.js
70+
#
71+
## Support for Copperlicht
72+
#./src/plugins/Copperlicht/Copperlicht.js
73+
#
74+
## Support for Pre3D
75+
#./src/plugins/Pre3D/Pre3D.js
7376

7477
!tpl:umd-footer.tpl.js # include a umd-footer template
7578

@@ -124,88 +127,6 @@ tasks =[{}]
124127
@
125128

126129

127-
build_three =[{}]
128-
129-
src =[]
130-
131-
!tpl:umd-header.tpl.js # include a umd-header template
132-
133-
# core
134-
./src/MOD3.js
135-
136-
./src/math/ModConstant.js
137-
./src/math/XMath.js
138-
./src/math/Range.js
139-
./src/math/Phase.js
140-
./src/math/Point.js
141-
./src/math/Matrix.js
142-
./src/math/Vector3.js
143-
./src/math/Matrix4.js
144-
./src/math/List.js
145-
146-
./src/core/Mesh.js
147-
./src/core/ModifierStack.js
148-
149-
# modifiers
150-
./src/modifiers/Pivot.js
151-
./src/modifiers/Bend.js
152-
./src/modifiers/Bloat.js
153-
./src/modifiers/Twist.js
154-
./src/modifiers/Skew.js
155-
./src/modifiers/Taper.js
156-
./src/modifiers/Wheel.js
157-
./src/modifiers/Break.js
158-
./src/modifiers/Noise.js
159-
./src/modifiers/DisplaceMap.js
160-
./src/modifiers/Perlin.js
161-
162-
# Support for Three.js
163-
./src/plugins/Three/Three.js
164-
165-
!tpl:umd-footer.tpl.js # include a umd-footer template
166-
167-
@
168-
169-
# extract header from this file
170-
header = ./src/MOD3.js
171-
172-
replace =[{}]
173-
174-
"@@ROOT@@" = "this"
175-
"@@EXPORTS@@" = "exports"
176-
"@@MODULE_NAME@@" = "MOD3"
177-
"@@MODULE_DEPENDENCIES@@" = "[ ['Classy'], ['./classy.js'] ]"
178-
"@@MODULE_ARGUMENTS@@" = "Classy"
179-
"@@VERSION@@" = "0.6.0"
180-
"@@DEPENDENCIES@@" = "@dependencies: Classy.js"
181-
"@@USE_STRICT@@" = '"use strict";'
182-
183-
@
184-
185-
# Minify the Package (map of lists)
186-
minify ={}
187-
188-
# Options for Node UglifyJS Compiler (if used, default), (mangle and compress)
189-
uglifyjs =[]
190-
-m -c
191-
@
192-
193-
# Options for Java Closure Compiler (if used)
194-
closure =[]
195-
"--language_in=ECMASCRIPT5_STRICT"
196-
@
197-
198-
# Options for Java YUI Compressor Compiler (if used)
199-
yui =[]
200-
--preserve-semi
201-
@
202-
203-
@
204-
205-
out = ./build/mod3.three.min.js
206-
207-
@
208-
209130
bundle =[{}]
210131

211132
bundle =[]

build-three.bat

Lines changed: 0 additions & 17 deletions
This file was deleted.

build/MOD3.min.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/mod3.bundle.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/Copperlicht/Bend.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
44
<script type="text/javascript" src="./copperlicht.js"></script>
55
<script type="text/javascript" src="../../build/mod3.bundle.js"></script>
6+
<script type="text/javascript" src="../../src/plugins/Copperlicht/Copperlicht.js"></script>
67
<script type="text/javascript" src="../js/Tween.js"></script>
78
<title>Bend demo and copperlicht.js</title>
89
</head>

examples/Copperlicht/Bloat.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
44
<script type="text/javascript" src="./copperlicht.js"></script>
55
<script type="text/javascript" src="../../build/mod3.bundle.js"></script>
6+
<script type="text/javascript" src="../../src/plugins/Copperlicht/Copperlicht.js"></script>
67
<script type="text/javascript" src="../js/Tween.js"></script>
78
<title>Bloat demo and copperlicht.js</title>
89
</head>

examples/Copperlicht/Break.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
44
<script type="text/javascript" src="./copperlicht.js"></script>
55
<script type="text/javascript" src="../../build/mod3.bundle.js"></script>
6+
<script type="text/javascript" src="../../src/plugins/Copperlicht/Copperlicht.js"></script>
67
<script type="text/javascript" src="../js/Tween.js"></script>
78
<title>Break demo and copperlicht.js</title>
89
</head>

examples/Copperlicht/Noise.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
44
<script type="text/javascript" src="./copperlicht.js"></script>
55
<script type="text/javascript" src="../../build/mod3.bundle.js"></script>
6+
<script type="text/javascript" src="../../src/plugins/Copperlicht/Copperlicht.js"></script>
67
<script type="text/javascript" src="../js/Tween.js"></script>
78
<title>Noise demo and copperlicht.js</title>
89
</head>

examples/Copperlicht/Skew.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
44
<script type="text/javascript" src="./copperlicht.js"></script>
55
<script type="text/javascript" src="../../build/mod3.bundle.js"></script>
6+
<script type="text/javascript" src="../../src/plugins/Copperlicht/Copperlicht.js"></script>
67
<script type="text/javascript" src="../js/Tween.js"></script>
78
<title>Skew demo and copperlicht.js</title>
89
</head>

0 commit comments

Comments
 (0)