Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
three.js-projector
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Дмитрий Никулин
three.js-projector
Commits
45d1a027
Commit
45d1a027
authored
Jul 29, 2016
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update three dep. Update to E6^
parent
a8c7af38
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
33 deletions
+27
-33
index.js
index.js
+27
-33
No files found.
index.js
View file @
45d1a027
...
@@ -4,21 +4,20 @@
...
@@ -4,21 +4,20 @@
* @author julianwa / https://github.com/julianwa
* @author julianwa / https://github.com/julianwa
*/
*/
define
([
'three'
],
function
(
THREE
,
BSPTree
){
import
THREE
from
'three.js'
;
var
Projector
=
{};
var
i
,
l
,
o
;
// counters
var
i
,
l
,
o
;
// counters
Projector
.
RenderableObject
=
function
()
{
export
class
RenderableObject
{
this
.
id
=
0
;
this
.
id
=
0
;
this
.
object
=
null
;
this
.
object
=
null
;
this
.
z
=
0
;
this
.
z
=
0
;
};
};
Projector
.
RenderableFace
=
function
()
{
export
function
RenderableFace
()
{
this
.
id
=
0
;
this
.
id
=
0
;
...
@@ -38,9 +37,9 @@ define(['three'], function(THREE, BSPTree){
...
@@ -38,9 +37,9 @@ define(['three'], function(THREE, BSPTree){
this
.
z
=
0
;
this
.
z
=
0
;
};
};
Projector
.
RenderableFace
.
prototype
.
copy
=
function
(
face
){
RenderableFace
.
prototype
.
copy
=
function
(
face
){
this
.
v1
.
copy
(
face
.
v1
);
this
.
v1
.
copy
(
face
.
v1
);
this
.
v2
.
copy
(
face
.
v2
);
this
.
v2
.
copy
(
face
.
v2
);
this
.
v3
.
copy
(
face
.
v3
);
this
.
v3
.
copy
(
face
.
v3
);
...
@@ -54,9 +53,9 @@ define(['three'], function(THREE, BSPTree){
...
@@ -54,9 +53,9 @@ define(['three'], function(THREE, BSPTree){
this
.
material
=
face
.
material
;
this
.
material
=
face
.
material
;
this
.
uvs
=
face
.
uvs
;
this
.
uvs
=
face
.
uvs
;
this
.
priority
=
face
.
priority
;
this
.
priority
=
face
.
priority
;
};
};
Projector
.
RenderableVertex
=
function
()
{
export
function
RenderableVertex
()
{
this
.
position
=
new
THREE
.
Vector3
();
this
.
position
=
new
THREE
.
Vector3
();
this
.
positionWorld
=
new
THREE
.
Vector3
();
this
.
positionWorld
=
new
THREE
.
Vector3
();
...
@@ -64,38 +63,38 @@ define(['three'], function(THREE, BSPTree){
...
@@ -64,38 +63,38 @@ define(['three'], function(THREE, BSPTree){
this
.
visible
=
true
;
this
.
visible
=
true
;
};
};
Projector
.
RenderableVertex
.
prototype
.
copy
=
function
(
vertex
)
{
RenderableVertex
.
prototype
.
copy
=
function
(
vertex
)
{
this
.
positionWorld
.
copy
(
vertex
.
positionWorld
);
this
.
positionWorld
.
copy
(
vertex
.
positionWorld
);
this
.
positionScreen
.
copy
(
vertex
.
positionScreen
);
this
.
positionScreen
.
copy
(
vertex
.
positionScreen
);
};
};
Projector
.
RenderableLine
=
function
()
{
export
function
RenderableLine
()
{
this
.
id
=
0
;
this
.
id
=
0
;
this
.
v1
=
new
Projector
.
RenderableVertex
();
this
.
v1
=
new
RenderableVertex
();
this
.
v2
=
new
Projector
.
RenderableVertex
();
this
.
v2
=
new
RenderableVertex
();
this
.
vertexColors
=
[
new
THREE
.
Color
(),
new
THREE
.
Color
()
];
this
.
vertexColors
=
[
new
THREE
.
Color
(),
new
THREE
.
Color
()
];
this
.
material
=
null
;
this
.
material
=
null
;
this
.
z
=
0
;
this
.
z
=
0
;
};
};
Projector
.
RenderableLine
.
prototype
.
copy
=
function
(
line
){
RenderableLine
.
prototype
.
copy
=
function
(
line
){
this
.
v1
.
copy
(
line
.
v1
);
this
.
v1
.
copy
(
line
.
v1
);
this
.
v2
.
copy
(
line
.
v2
);
this
.
v2
.
copy
(
line
.
v2
);
this
.
vertexColors
=
line
.
vertexColors
;
this
.
vertexColors
=
line
.
vertexColors
;
this
.
material
=
line
.
material
;
this
.
material
=
line
.
material
;
};
};
Projector
.
RenderableSprite
=
function
()
{
export
function
RenderableSprite
()
{
this
.
id
=
0
;
this
.
id
=
0
;
...
@@ -110,9 +109,9 @@ define(['three'], function(THREE, BSPTree){
...
@@ -110,9 +109,9 @@ define(['three'], function(THREE, BSPTree){
this
.
material
=
null
;
this
.
material
=
null
;
};
};
Projector
.
Projector
=
function
()
{
export
function
Projector
()
{
var
_object
,
_objectCount
,
_objectPool
=
[],
_objectPoolLength
=
0
,
var
_object
,
_objectCount
,
_objectPool
=
[],
_objectPoolLength
=
0
,
_vertex
,
_camera
,
_vertexCount
,
_vertexPool
=
[],
_vertexPoolLength
=
0
,
_vertex
,
_camera
,
_vertexCount
,
_vertexPool
=
[],
_vertexPoolLength
=
0
,
...
@@ -788,7 +787,7 @@ define(['three'], function(THREE, BSPTree){
...
@@ -788,7 +787,7 @@ define(['three'], function(THREE, BSPTree){
if
(
_objectCount
===
_objectPoolLength
)
{
if
(
_objectCount
===
_objectPoolLength
)
{
var
object
=
new
Projector
.
RenderableObject
();
var
object
=
new
RenderableObject
();
_objectPool
.
push
(
object
);
_objectPool
.
push
(
object
);
_objectPoolLength
++
;
_objectPoolLength
++
;
_objectCount
++
;
_objectCount
++
;
...
@@ -804,7 +803,7 @@ define(['three'], function(THREE, BSPTree){
...
@@ -804,7 +803,7 @@ define(['three'], function(THREE, BSPTree){
if
(
_vertexCount
===
_vertexPoolLength
)
{
if
(
_vertexCount
===
_vertexPoolLength
)
{
var
vertex
=
new
Projector
.
RenderableVertex
();
var
vertex
=
new
RenderableVertex
();
_vertexPool
.
push
(
vertex
);
_vertexPool
.
push
(
vertex
);
_vertexPoolLength
++
;
_vertexPoolLength
++
;
_vertexCount
++
;
_vertexCount
++
;
...
@@ -820,7 +819,7 @@ define(['three'], function(THREE, BSPTree){
...
@@ -820,7 +819,7 @@ define(['three'], function(THREE, BSPTree){
if
(
_faceCount
===
_facePoolLength
)
{
if
(
_faceCount
===
_facePoolLength
)
{
var
face
=
new
Projector
.
RenderableFace
();
var
face
=
new
RenderableFace
();
_facePool
.
push
(
face
);
_facePool
.
push
(
face
);
_facePoolLength
++
;
_facePoolLength
++
;
_faceCount
++
;
_faceCount
++
;
...
@@ -837,7 +836,7 @@ define(['three'], function(THREE, BSPTree){
...
@@ -837,7 +836,7 @@ define(['three'], function(THREE, BSPTree){
if
(
_lineCount
===
_linePoolLength
)
{
if
(
_lineCount
===
_linePoolLength
)
{
var
line
=
new
Projector
.
RenderableLine
();
var
line
=
new
RenderableLine
();
_linePool
.
push
(
line
);
_linePool
.
push
(
line
);
_linePoolLength
++
;
_linePoolLength
++
;
_lineCount
++
;
_lineCount
++
;
...
@@ -853,7 +852,7 @@ define(['three'], function(THREE, BSPTree){
...
@@ -853,7 +852,7 @@ define(['three'], function(THREE, BSPTree){
if
(
_spriteCount
===
_spritePoolLength
)
{
if
(
_spriteCount
===
_spritePoolLength
)
{
var
sprite
=
new
Projector
.
RenderableSprite
();
var
sprite
=
new
RenderableSprite
();
_spritePool
.
push
(
sprite
);
_spritePool
.
push
(
sprite
);
_spritePoolLength
++
;
_spritePoolLength
++
;
_spriteCount
++
;
_spriteCount
++
;
...
@@ -1331,9 +1330,4 @@ define(['three'], function(THREE, BSPTree){
...
@@ -1331,9 +1330,4 @@ define(['three'], function(THREE, BSPTree){
}
}
};
};
return
Projector
;
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment