Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DMDesign
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amanda Ghassaei
DMDesign
Commits
5026a17a
Commit
5026a17a
authored
10 years ago
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
no cell added during camera moves
parent
9874bcbd
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/threeViews/threeView.js
+18
-5
18 additions, 5 deletions
js/threeViews/threeView.js
with
18 additions
and
5 deletions
js/threeViews/threeView.js
+
18
−
5
View file @
5026a17a
...
@@ -59,29 +59,42 @@ ThreeView = Backbone.View.extend({
...
@@ -59,29 +59,42 @@ ThreeView = Backbone.View.extend({
mouseUp
:
function
(){
mouseUp
:
function
(){
this
.
mouseIsDown
=
false
;
this
.
mouseIsDown
=
false
;
if
(
!
this
.
highlighter
.
visible
)
return
;
var
cell
=
new
Cell
(
this
.
highlighter
.
geometry
.
vertices
[
0
]);
window
.
three
.
render
();
},
},
mouseDown
:
function
(
e
){
mouseDown
:
function
(
e
){
this
.
mouseIsDown
=
true
;
this
.
mouseIsDown
=
true
;
if
(
!
this
.
highlighter
.
visible
)
return
;
var
cell
=
new
Cell
(
this
.
highlighter
.
geometry
.
vertices
[
0
]);
window
.
three
.
render
();
},
},
mouseMoved
:
function
(
e
){
mouseMoved
:
function
(
e
){
if
(
this
.
mouseIsDown
)
return
;
//in the middle of a drag event
if
(
this
.
mouseIsDown
)
{
this
.
highlighter
.
visible
=
false
;
window
.
three
.
render
();
return
;
}
//in the middle of a drag event
var
vector
=
new
THREE
.
Vector2
(
2
*
(
e
.
pageX
-
this
.
$el
.
offset
().
left
)
/
this
.
$el
.
width
()
-
1
,
1
-
2
*
(
e
.
pageY
-
this
.
$el
.
offset
().
top
)
/
this
.
$el
.
height
());
var
vector
=
new
THREE
.
Vector2
(
2
*
(
e
.
pageX
-
this
.
$el
.
offset
().
left
)
/
this
.
$el
.
width
()
-
1
,
1
-
2
*
(
e
.
pageY
-
this
.
$el
.
offset
().
top
)
/
this
.
$el
.
height
());
var
camera
=
this
.
model
.
camera
;
var
camera
=
this
.
model
.
camera
;
this
.
mouseProjection
.
setFromCamera
(
vector
,
camera
);
this
.
mouseProjection
.
setFromCamera
(
vector
,
camera
);
var
intersections
=
this
.
mouseProjection
.
intersectObjects
(
this
.
model
.
objects
,
true
);
var
intersections
=
this
.
mouseProjection
.
intersectObjects
(
this
.
model
.
objects
,
true
);
if
(
intersections
.
length
==
0
)
return
;
//check if we're intersecting anything
if
(
intersections
.
length
==
0
)
{
if
(
this
.
highlighter
.
visible
)
{
this
.
highlighter
.
visible
=
false
;
window
.
three
.
render
();
}
return
;
}
//check if we've moved to a new face
//check if we've moved to a new face
var
intersection
=
intersections
[
0
].
face
;
var
intersection
=
intersections
[
0
].
face
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment