是否可以将地板的原点从中心更改为Webots中的左上角? 例如,那么矩形竞技场的大小为20x20,我想将其原点设置为0,0到10,10
答案 0 :(得分:1)
是的,您可以通过创建自己的原始文件来做到这一点。我建议您从现有的原型开始,例如from bokeh.plotting import figure, show
p = figure(name = 'Doggys', x_range = (2, 18), y_range = (-10, 10))
p.image_url(url = ['https://cdn3.iconfinder.com/data/icons/line/36/dog_head-512.png'], x = [10], y = [0], w = [50], h = [50], h_units = 'screen', w_units = 'screen')
p.image_url(url = ['https://cdn3.iconfinder.com/data/icons/dogs-outline/100/dog-02-512.png'], x = [5], y = [5], w = [50], h = [50], h_units = 'screen', w_units = 'screen')
show(p)
。例如,将此文件复制并重命名为WEBOTS_HOME/projects/objects/floors/protos/Floor.proto
,然后对其进行编辑以更改MyFloor.proto
节点的坐标。通常,您必须更换:
IndexedFaceSet
作者:
geometry IndexedFaceSet {
coord Coordinate {
point [
%{= -(size.x / 2) }% 0 %{= -(size.y / 2) }%
%{= size.x / 2 }% 0 %{= -(size.y / 2) }%
%{= -(size.x / 2) }% 0 %{= size.y / 2 }%
%{= size.x / 2 }% 0 %{= size.y / 2 }%
]
}
这将使地板原点移动到地板的一角。 另外,应该更新boundingObject,以便在选定地板时看起来更好。替换:
geometry IndexedFaceSet {
coord Coordinate {
point [
0 0 0
%{= size.x }% 0 0
0 0 %{= size.y }%
%{= size.x }% 0 %{= size.y }%
]
}
作者:
boundingObject Plane {
size IS size
}