Hey guys tried implementing putting box’s along the radius of a circular orbit but having some difficulties, sorry am a newb
am i doing anything obviously wrong ?
oh and the start angle would be 180 and the end angle would be 45 and tried it on different distances but nothing.
[java]
private void buildAsteroids(int d, int startAngle, int endAngle)
{
Node roidsNode = new Node(“roidsNode”);
Float x,z;
for(int i = startAngle ; i <= endAngle; i-=10)
{
x = FastMath.cos(i) * d; //see polar co ordinates converting them to cartesian ones
z = FastMath.sin(i) * d;
Box roid = new Box("mockRoid " + i,new Vector3f(x,0,z),
new Vector3f(x+1,0+1,z+1));
roidsNode.attachChild(roid);
}
Box helloBox = new Box(“hello”,new Vector3f(0,0,10),
new Vector3f(1,1,11));
roidsNode.attachChild(helloBox);
TextureState roidTS = display.getRenderer().createTextureState();
// Use the TextureManager to load a texture
Texture t = TextureManager.loadTexture(Game.class.getClassLoader().getResource(“GamePics/1.jpg”),
Texture.MinificationFilter.BilinearNearestMipMap,
Texture.MagnificationFilter.Bilinear);
// Assign the texture to the TextureState
roidTS.setTexture(t);
roidsNode.setRenderState(roidTS);
root.attachChild(roidsNode);
}
[/java]
bit embarassing putting my code up but ah well lol,
one thing i noticed is that the many asteroids bar the “Hello” one is not being attached to the roidsNode in program output…
anyone got an idea as to the problem ?
oops i found the prob it was v minor , soz thought was much more complicated error after couldnt see it.
i put <= instead of >= lol
oops :S