我是 Three.js 的新手,所以也许我不会以最佳方式接近这个,
我有如下创建的几何图形,
const geo = new THREE.PlaneBufferGeometry(10,0);
Run Code Online (Sandbox Code Playgroud)
然后我对其应用旋转
geo.applyMatrix( new THREE.Matrix4().makeRotationX( Math.PI * 0.5 ) );
Run Code Online (Sandbox Code Playgroud)
然后我从中创建一个网格
const open = new THREE.Mesh( geo, materialNormal);
Run Code Online (Sandbox Code Playgroud)
然后我对网格应用一系列操作以正确定位它,如下所示:
open.position.copy(v2(10,20);
open.position.z = 0.5*10
open.position.x -= 20
open.position.y -= 10
open.rotation.z = angle;
Run Code Online (Sandbox Code Playgroud)
现在在位置改变之前和之后获取网格顶点的最佳方法是什么?我很惊讶地发现网格的顶点没有内置到three.js 中。
任何提示和代码示例将不胜感激。
我有以下代码.
for (String str5 : verticesposition2) {
if(!str5.contains(("Vertex")||("Name")||("Transmittance")) {
System.out.println(str5);
}
}
Run Code Online (Sandbox Code Playgroud)
如上所示,如果字符串不包含Vertex,Name或Transmittance,我希望它打印出来.但是我得到编译错误说|| 对于参数类型,运算符未定义.我对编程比较陌生,所以我不确定这意味着有什么能指出如何修复代码的正确方向?
我想比较相同的元素,List (The List "list)如果它们相同,则打印出一行,我对编程还很陌生,我还没有完全理解List和数组之间的区别以及何时使用它们。
有人好心地建议了下面的代码,虽然它编译了但没有打印出来。由于我的数组中有两对,我希望至少打印一次。任何帮助将不胜感激谢谢!
List<Double> list = new ArrayList<Double>();
while (search.find()){
list.add(Double.parseDouble(search.group(1)));
}
for(int i= 0 ; i < list.size()-1; i++){
//System.out.println(list.get(i)); // Successfully prints out all doubles in the SHADING:BUILDING:DETAILED class
for(int k = i+1 ; k < list.size() ; k++){
if(list.get(i) == list.get(k)){
System.out.println(i + "and" + k + "are pairs");
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 我有以下代码
class PV_gen(object):
def __init__(self,_name,surfacename_,performance_type = "PhotovoltaicPerformance:Simple",performance_name,_integrationmode,No_parallel,No_series):
self.name = _name
self.surfacename = surfacename_
self.performancetype = performance_type
self.performancename = performance_name
self.integrationmode = _integrationmode
self.NOparallel = No_parallel
self.NOseries = No_series
self.PV_performance()
def PV_performance(self,_namenamePVperform = "test",SA_solarcells = 0.5 ,cell_efficiencyinputmode = "Fixed",cell_n = 0.12, schedule_ = "always on"):
self.name = _namenamePVperform
self.surfaceareacells = SA_solarcells
self.cellefficiencyinputmode = cell_efficiencyinputmode
self.efficiency = cell_n
self.schedule = schedule_
Run Code Online (Sandbox Code Playgroud)
每当我尝试在init 中指定默认值时,我都会收到类似这样的运行时错误
运行时错误(SyntaxErrorException):此处必须指定默认值 File "", line 5 def init (self, name,surfacename ,performance_type = "PhotovoltaicPerformance:Simple",performance_name,_integrationmode,No_parallel,No_series):
语法错误:必须在此处指定默认值
我只是无法弄清楚这里出了什么问题我想指定 performance_type 具有字符串“PhotovoltaicPerformance:Simple”的默认值。有人可以给我一些指点吗?
java ×2
arraylist ×1
contains ×1
javascript ×1
list ×1
python ×1
string ×1
syntax-error ×1
three.js ×1