本文整理了Java中us.ihmc.graphicsDescription.appearance.YoAppearance.getStandardRoyGBivRainbow()
方法的一些代码示例,展示了YoAppearance.getStandardRoyGBivRainbow()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoAppearance.getStandardRoyGBivRainbow()
方法的具体详情如下:
包路径:us.ihmc.graphicsDescription.appearance.YoAppearance
类名称:YoAppearance
方法名:getStandardRoyGBivRainbow
暂无
代码示例来源:origin: us.ihmc/IHMCGraphicsDescription
/**
* Create a Bag of Balls with alternating ball color going through the cycle of the colors of the rainbow.
*
* @param numberOfBalls int Number of balls to create.
* @param sizeInMeters double Size of each ball in meters.
* @param name String Name of the BagOfBalls to create.
* @param parentYoVariableRegistry YoVariableRegistry to register the BagOfBalls with.
* @param yoGraphicsListRegistry DynamicGraphicObjectsListRegistry to register the BagOfBalls with.
* @return BagOfBalls
*/
public static BagOfBalls createRainbowBag(int numberOfBalls, double sizeInMeters, String name, YoVariableRegistry parentYoVariableRegistry,
YoGraphicsListRegistry yoGraphicsListRegistry)
{
AppearanceDefinition[] rainbow = YoAppearance.getStandardRoyGBivRainbow();
ArrayList<AppearanceDefinition> appearances = new ArrayList<AppearanceDefinition>();
for (int i = 0; i < numberOfBalls; i++)
{
appearances.add(rainbow[i % rainbow.length]);
}
return new BagOfBalls(sizeInMeters, name, appearances, parentYoVariableRegistry, yoGraphicsListRegistry);
}
代码示例来源:origin: us.ihmc/ihmc-graphics-description
/**
* Create a Bag of Balls with alternating ball color going through the cycle of the colors of the
* rainbow.
*
* @param numberOfBalls int Number of balls to create.
* @param sizeInMeters double Size of each ball in meters.
* @param name String Name of the BagOfBalls to create.
* @param parentYoVariableRegistry YoVariableRegistry to register the BagOfBalls with.
* @param yoGraphicsListRegistry YoGraphicsListRegistry to register the BagOfBalls
* with.
* @return BagOfBalls
*/
public static BagOfBalls createRainbowBag(int numberOfBalls, double sizeInMeters, String name, YoVariableRegistry parentYoVariableRegistry,
YoGraphicsListRegistry yoGraphicsListRegistry)
{
AppearanceDefinition[] rainbow = YoAppearance.getStandardRoyGBivRainbow();
ArrayList<AppearanceDefinition> appearances = new ArrayList<>();
for (int i = 0; i < numberOfBalls; i++)
{
appearances.add(rainbow[i % rainbow.length]);
}
return new BagOfBalls(sizeInMeters, name, appearances, parentYoVariableRegistry, yoGraphicsListRegistry);
}
代码示例来源:origin: us.ihmc/IHMCSimulationToolkit
public static Graphics3DNode drawHeightMap(QuadTreeHeightMapInterface heightMap, SimulationConstructionSet scs, double minX, double minY, double maxX, double maxY, double resolution)
{
AppearanceDefinition[] rainbow = YoAppearance.getStandardRoyGBivRainbow();
Graphics3DObject heightMapGraphic = new Graphics3DObject();
for (double x = minX; x<maxX; x = x + resolution)
{
for (double y = minY; y<maxY; y = y + resolution)
{
double z = heightMap.getHeightAtPoint(x, y);
if (!Double.isNaN(z))
{
int index = (int) (z / resolution);
index = index % rainbow.length;
if (index < 0) index = index + rainbow.length;
AppearanceDefinition appearance = rainbow[index];
heightMapGraphic.identity();
heightMapGraphic.translate(x, y, z - resolution/4.0);
heightMapGraphic.addCube(resolution, resolution, resolution/4.0, appearance);
}
}
}
return scs.addStaticLinkGraphics(heightMapGraphic);
}
代码示例来源:origin: us.ihmc/ihmc-simulation-toolkit
public static Graphics3DNode drawHeightMap(QuadTreeHeightMapInterface heightMap, SimulationConstructionSet scs, double minX, double minY, double maxX, double maxY, double resolution)
{
AppearanceDefinition[] rainbow = YoAppearance.getStandardRoyGBivRainbow();
Graphics3DObject heightMapGraphic = new Graphics3DObject();
for (double x = minX; x<maxX; x = x + resolution)
{
for (double y = minY; y<maxY; y = y + resolution)
{
double z = heightMap.getHeightAtPoint(x, y);
if (!Double.isNaN(z))
{
int index = (int) (z / resolution);
index = index % rainbow.length;
if (index < 0) index = index + rainbow.length;
AppearanceDefinition appearance = rainbow[index];
heightMapGraphic.identity();
heightMapGraphic.translate(x, y, z - resolution/4.0);
heightMapGraphic.addCube(resolution, resolution, resolution/4.0, appearance);
}
}
}
return scs.addStaticLinkGraphics(heightMapGraphic);
}
代码示例来源:origin: us.ihmc/IHMCSimulationToolkit
private static void drawNodeBoundingBoxesRecursively(QuadTreeForGroundNode node, Graphics3DObject nodeBoundsGraphic, int depth, double nodeZ)
AppearanceDefinition[] rainbow = YoAppearance.getStandardRoyGBivRainbow();
代码示例来源:origin: us.ihmc/ihmc-simulation-toolkit
private static void drawNodeBoundingBoxesRecursively(QuadTreeForGroundNode node, Graphics3DObject nodeBoundsGraphic, int depth, double nodeZ)
AppearanceDefinition[] rainbow = YoAppearance.getStandardRoyGBivRainbow();
内容来源于网络,如有侵权,请联系作者删除!