我有一个项目的下拉列表和一个弹出窗口(用于打开弹出窗口的颜色框)和一个复选框列表.单击"+添加/编辑"即会显示弹出窗口.下拉项和复选框都是在PHP中从complaint.csv文件生成的.
complaint.csv文件
1,complaint type 1
2,complaint type 2
3,complaint type 3
etc...
Run Code Online (Sandbox Code Playgroud)
PHP代码
<label class="question-name" ng-class="{error:hasError()}">
<span class="ng-binding" ng-hide="question.nameHiddenOnMobile">
Chief Complaint
</span>
<span class="icon-required" ng-show="question.required"></span>
</label>
<select name="Language.PrimarySpoken" ng-hide="showAddAnswer"
ng-model="question.response.value"
ng-options="a.text as a.getText() for a in question.answers.items"
id="Language.PrimarySpoken" ng-value="a.text" class="input-wide"
ng-class="{error:hasError()}">
<option class="hidden" disabled="disabled" value=""></option>
<?php
$file_handle = fopen("../complaint.csv", "r");
while (!feof($file_handle)) {
$lines_of_text[] = fgetcsv($file_handle, 1024);
}
fclose($file_handle);
foreach ( $lines_of_text as $line_of_text):
?>
<option value="<?php print $line_of_text[1]; ?>">
<?php print $line_of_text[1]; ?></option>
<?php endforeach; …Run Code Online (Sandbox Code Playgroud) 我正在创建three.js应用程序.我已经加载了我的STL对象.我使用过'OrbitControls'.当我用鼠标的中间滚动按钮开始缩放我的对象时,它会在某个时刻中断.
我的相机和控制代码如下:
camera = new THREE.PerspectiveCamera( 55, window.innerWidth / window.innerHeight, 1, 15 );
//camera.position.set( 3, 0.15, 3 );
// position and point the camera to the center of the scene
camera.position.x = -3;
camera.position.y = 4;
camera.position.z = 5;
camera.lookAt(new THREE.Vector3(0, 0, 0));
controls = new THREE.OrbitControls( camera, renderer.domElement );
controls.damping = 0.2;
//controls.minZoom = 0;
// controls.maxZoom = 1;
//controls .noZoom = true;
controls.addEventListener( 'change', render );
Run Code Online (Sandbox Code Playgroud)
我尝试使用控件minZoom,maxZoom但它不起作用.
任何人都可以告诉我,我应该如何限制缩放,以便在某些时候我的对象不会破坏?
即使主体背景颜色为#135462,下面的代码也显示黑屏。我认为由于渲染代码而显示黑屏。但无法删除黑屏并获取背景颜色。
对象也没有显示在屏幕上。我的对象链接可以在这里找到:https://www.dropbox.com/s/ukw7k1vyqkg4f7d/SupermanSmall.json ?dl=0
任何人都知道为什么会发生这种情况?
<!DOCTYPE html>
<html lang="en">
<head>
<title>My three.js</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
background:#135462;
color:#fff;
padding:0;
margin:0;
overflow:hidden;
font-family:georgia;
text-align:center;
}
</style>
</head>
<body>
<script src="js/three.min.js"></script>
<script src="js/loaders/BinaryLoader.js"></script>
<script src="js/loaders/ObjectLoader.js"></script>
<script src="js/Detector.js"></script>
<script>
if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
var container;
var camera, scene, renderer;
var windowHalfX = window.innerWidth / 2;
var windowHalfY = window.innerHeight / 2;
init();
animate();
function init() {
container = document.createElement( 'div' );
document.body.appendChild( container ); …Run Code Online (Sandbox Code Playgroud) 我经历了不同的three.js例子.一些示例使用.js或.bin文件而不是.obj文件.例如,在webgl_materials_cars.html示例中使用.如何获取.obj文件的.js文件?