Fix field of view during embedding.
This commit is contained in:
parent
73417f2a90
commit
19b81d0b4c
50
sandbox/embed_camera.html
Normal file
50
sandbox/embed_camera.html
Normal file
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
OV.Init3DViewerElements ();
|
||||
</script>
|
||||
|
||||
<style>
|
||||
div.online_3d_viewer, iframe
|
||||
{
|
||||
float: left;
|
||||
border: 1px solid #eeeeee;
|
||||
margin: 0px 4px 4px 0px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<iframe
|
||||
width="400" height="300" style="border:1px solid #eeeeee;"
|
||||
src="../../website/embed.html#model=assets/models/solids.obj,assets/models/solids.mtl$camera=2.18558,4.53834,2.35460,3.62488,2.61927,-0.52401,0.00000,1.00000,0.00000$envsettings=fishermans_bastion,off$backgroundcolor=255,255,255$defaultcolor=200,200,200$edgesettings=off,0,0,0,1">
|
||||
</iframe>
|
||||
|
||||
<iframe
|
||||
width="400" height="300" style="border:1px solid #eeeeee;"
|
||||
src="../../website/embed.html#model=assets/models/solids.obj,assets/models/solids.mtl$camera=2.18558,4.53834,2.35460,3.62488,2.61927,-0.52401,0.00000,1.00000,0.00000,100.0$envsettings=fishermans_bastion,off$backgroundcolor=255,255,255$defaultcolor=200,200,200$edgesettings=off,0,0,0,1">
|
||||
</iframe>
|
||||
|
||||
<div class="online_3d_viewer"
|
||||
style="width: 400px; height: 300px;"
|
||||
model="../website/assets/models/solids.obj,../website/assets/models/solids.mtl"
|
||||
camera="2.18558,4.53834,2.35460,3.62488,2.61927,-0.52401,0.00000,1.00000,0.00000">
|
||||
</div>
|
||||
|
||||
<div class="online_3d_viewer"
|
||||
style="width: 400px; height: 300px;"
|
||||
model="../website/assets/models/solids.obj,../website/assets/models/solids.mtl"
|
||||
camera="2.18558,4.53834,2.35460,3.62488,2.61927,-0.52401,0.00000,1.00000,0.00000,100.0">
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
<title>Online 3D Viewer</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<iframe
|
||||
width="640" height="480" style="border:1px solid #eeeeee;"
|
||||
src="../../website/embed.html#model=assets/models/solids.obj,assets/models/solids.mtl$camera=2.18558,4.53834,2.35460,3.62488,2.61927,-0.52401,0.00000,1.00000,0.00000$envsettings=fishermans_bastion,off$backgroundcolor=255,255,255$defaultcolor=200,200,200$edgesettings=off,0,0,0,1">
|
||||
</iframe>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,34 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
OV.Init3DViewerElements ();
|
||||
</script>
|
||||
|
||||
<style>
|
||||
div.online_3d_viewer
|
||||
{
|
||||
float: left;
|
||||
border: 1px solid #eeeeee;
|
||||
margin: 0px 4px 4px 0px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="online_3d_viewer"
|
||||
style="width: 640px; height: 480px;"
|
||||
model="../website/assets/models/solids.obj,../website/assets/models/solids.mtl"
|
||||
camera="2.18558,4.53834,2.35460,3.62488,2.61927,-0.52401,0.00000,1.00000,0.00000">
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -61,7 +61,7 @@ export let ParameterConverter =
|
||||
return null;
|
||||
}
|
||||
let paramParts = str.split (',');
|
||||
if (paramParts.length < 9) {
|
||||
if (paramParts.length !== 9 && paramParts.length !== 10) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -299,6 +299,8 @@ export class Viewer
|
||||
SetCamera (camera)
|
||||
{
|
||||
this.navigation.SetCamera (camera);
|
||||
this.camera.fov = camera.fov;
|
||||
this.camera.updateProjectionMatrix ();
|
||||
this.Render ();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user