Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
freecad_x3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
freecad_x3d
Commits
7efaa25e
Commit
7efaa25e
authored
Dec 27, 2015
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.webgl not supported 2.flash disabled for good
parent
963ba781
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
4 deletions
+58
-4
viewmodel.js
x3d_web_viewer/viewmodel.js
+58
-4
No files found.
x3d_web_viewer/viewmodel.js
View file @
7efaa25e
...
...
@@ -40,6 +40,11 @@ function resize(){
$
(
"#title"
).
css
({
left
:
(
$
(
"#main"
).
width
()
/
2
-
$
(
"#title"
).
width
()
/
2
)
+
"px"
,
});
$
(
"#webgl_error"
).
css
({
top
:(
$
(
"#main"
).
height
()
/
2
-
$
(
"#webgl_error"
).
height
()
/
2
)
+
"px"
});
}
var
resizeTimer
;
...
...
@@ -115,9 +120,55 @@ function prerun(){
}
//load x3dom.js
//$.getScript("x3dom-1.7.0/x3dom.
js");
//$.getScript("x3dom-1.7.0/x3dom.
debug.js",function(){
//$.getScript("http://x3dom.org/download/1.7.1/x3dom.js");
$
.
getScript
(
"http://x3dom.org/download/1.7/x3dom.js"
);
$
.
getScript
(
"http://x3dom.org/download/1.7/x3dom.js"
,
function
(){
x3dom
.
runtime
.
ready
=
function
()
{
//x3dom.caps.BACKEND
if
(
x3dom
.
caps
.
BACKEND
!=
"webgl"
){
var
webgl_error_background
=
$
(
"<div>"
).
css
({
position
:
"absolute"
,
top
:
"0px"
,
left
:
"0px"
,
width
:
"100%"
,
height
:
"100%"
,
background
:
"black"
,
"z-index"
:
"999"
});
var
webgl_error
=
$
(
"<div>"
,{
id
:
"webgl_error"
}).
css
({
position
:
"absolute"
,
top
:
"0px"
,
left
:
"0px"
,
width
:
"100%"
,
color
:
"white"
,
"font-size"
:
"1.4em"
,
"font-weight"
:
"bold"
,
"text-align"
:
"center"
,
background
:
"black"
,
"z-index"
:
"1000"
}).
html
(
"
\
This browser does not support WebGL. Please, check at <a style='color:rgba(100,200,255,1)' href='http://get.webgl.org/'>get.webgl.org</a><br/>
\
X3DOM Flash version is not available.<br/>
\
"
);
$
(
"#main"
).
append
(
webgl_error_background
).
append
(
webgl_error
);
webgl_error
.
css
({
top
:(
$
(
"#main"
).
height
()
/
2
-
webgl_error
.
height
()
/
2
)
+
"px"
});
//console.log($("#x3dom-x3d_canvas-object"));
$
(
"#x3dom-x3d_canvas-object"
).
remove
();
}
};
});
/*
x3dom.runtime.ready = function() {
console.log("About to render something the first time");
console.log("Backend2: "+x3dom.X3DCanvas.backend);
};
*/
var
settings
=
$
(
"<div>"
).
load
(
settings_file
,
function
(
response
,
status
,
xhr
){
if
(
xhr
.
status
==
200
){
...
...
@@ -138,6 +189,7 @@ function prerun(){
var
showall
=
1
;
var
element
=
document
.
getElementById
(
'x3d_canvas'
);
$
(
document
).
load
(
function
(){
element
.
runtime
.
enterFrame
=
function
()
{
if
(
showall
==
1
)
{
element
.
runtime
.
examine
();
...
...
@@ -712,8 +764,10 @@ function bindCanvas(){
var
switch_click_time
=
0
;
function
mouseleft
(
e
){
if
(
e
.
which
==
1
){
console
.
log
(
"Mouseleft!"
);
mouseended
(
e
);
}
}
function
touchcanceled
(
e
){
...
...
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