我需要用把手模板一个json对象的数组:(通过chrome控制台)[对象,对象,对象,对象]其中每个对象由这个属性组成:name,surname,ecc.
我已经明白将把对象放在把手中是不可能的,但我们必须用数组所有对象的所有属性创建一个唯一的对象.任何人都可以建议我创建它的功能
当我执行一些几何体的渲染时,我可以在控制台中看到这个警告:
THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.
Run Code Online (Sandbox Code Playgroud)
我无法理解我的画布的原因和背景是完全黑色的.
我尝试在一次拍摄中创建一个从场景中删除所有对象的函数,但它只删除了一个用于调用的对象.
GeometryModel.prototype.clearScene = function(scene) {
var i;
for(i=0; i < scene.children.length; i++){
obj = scene.children[i];
scene.remove(obj);
}
}
Run Code Online (Sandbox Code Playgroud)
我试过的另一个解决方案是有效的:
scene.children={};
Run Code Online (Sandbox Code Playgroud)
但我不确定它是否正确.
我需要在需要特殊api密钥的服务器上发出请求,我需要使用crud方法tu更新我的模型并尽快...
例如,我在ajax中有这个代码来从服务器获取元素:
function getapi() {
$.ajax({
url: 'https://api.parse.com/1/classes/autolavaggi/QSfl*****',
type: 'GET',
dataType: 'json',
success: function(obj) {
alert("nome autolavaggio "+obj.nome);
},
error: function() {
alert('Errore');
},
beforeSend: setHeader
});
}
//GET GET GET GET GET GET GET GET Header Header Header Header
function setHeader(xhr) {
xhr.setRequestHeader('X-Parse-Application-Id', 'aqLJlmE2rRXBOy***************');
xhr.setRequestHeader('X-Parse-REST-API-Key', 'gvT2Isd5vAvjgq*****************');
}
Run Code Online (Sandbox Code Playgroud)
我该如何将这个特定的ajax调用分配给crud方法save,fetch或者另一个?
我用threejs的基本场景进行了试验,但我不明白为什么画布背景是完全黑色的.
<html>
<head>
<title>My first Three.js app</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100%;background-color: white; }
</style>
</head>
<body>
<script src="Stereos/threejs/three.js"></script>
<script>
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
编辑:
代码在felpone.netsons.org
以下文章如何使用Laravel Eloquent创建多个where子句查询?
我试图插入多个'和'条件:
$matchThese = ['destination.country' => 'china', 'doc.description' => 'business'];
return $collection->where($matchThese);
Run Code Online (Sandbox Code Playgroud)
但是我收到这个错误:
Too few arguments to function Illuminate\Support\Collection::where(), 1 passed . . . but two expected
Run Code Online (Sandbox Code Playgroud) 我创建了一个控制器:
@RequestMapping(value = "/photo/" , method = RequestMethod.POST)
public @ResponseBody
void addPhotoData(@RequestBody Photo photo, @RequestParam("data")
MultipartFile photoData) {
InputStream in = null;
try {
in = photoData.getInputStream();
photoService.save(photo, in);
} catch (IOException e) {
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
我不明白为什么收到错误 415 not support。帮助!
我正在搜索一个集合,我希望这个搜索大小写不敏感或至少以小写形式更改集合值.我怎样才能做到这一点?
$value = strtolower($value);
$collection = $collection->where($attribute, $value);
Run Code Online (Sandbox Code Playgroud)
$ value是小写,而集合中的内容不是,所以没有匹配.
我制作了一个raycaster来交叉画布中的一些对象.如果在窗口浏览器中单独使用canvas,但是如果我将canvas放在其他GUI中并且因此画布的位置不同,则它不会交叉.我认为这是鼠标坐标的问题.我该怎么调试呢?如果我知道鼠标坐标怎样才能理解画布的坐标是什么?
function getPosition(event) {
// TODO: add the border of the canvas
var x = new Number();
var y = new Number();
if (event.x != undefined && event.y != undefined) {
x = event.x;
y = event.y;
} else {
// Firefox method to get the position
x = event.clientX + document.body.scrollLeft +
document.documentElement.scrollLeft;
y = event.clientY + document.body.scrollTop +
document.documentElement.scrollTop;
}
x -= canvas.offsetLeft;
y -= canvas.offsetTop;
return {x: x, y: y};
}
Run Code Online (Sandbox Code Playgroud) 我在 Laravel 中写了一个迁移:
Schema::create('test', function (Blueprint $table) {
//
$table->increments('id');
$table->string('city','30')->unique();
$table->string('car','30')->unique();
$table->boolean('required');
$table->string('street','100')->nullable();
$table->json('files');
$table->timestamp('created_at');
});
Run Code Online (Sandbox Code Playgroud)
所需的字段定义为布尔值,但在 db (MySql) 中创建为 tinyint。这怎么可能?
three.js ×4
javascript ×3
laravel ×3
php ×3
backbone.js ×1
canvas ×1
java ×1
json ×1
spring ×1