Original Post
I'm trying to create a background nebula effect (in space), I've got it all set up. It's view oriented, but when I turn the camera, the Nebula turns WITH the camera, and I need it to... not turn, but stay static. This is how it looks when facing the planet,
But as I turn toward the nebula, it gets closer & closer to the camera, until it eventually passes through. So does anybody have any suggestions, or see where I'm going wrong in my drawing code:
But as I turn toward the nebula, it gets closer & closer to the camera, until it eventually passes through. So does anybody have any suggestions, or see where I'm going wrong in my drawing code:
device.Transform.World = Matrix.RotationX(0) * Matrix.RotationY(0) *
Matrix.RotationZ(0) * Matrix.Translation(0,0,0);
nebulaSprite.SetWorldViewLH(World, View);
sectorNebulas n = (sectorNebulas)Nebula[index];
nebulaSprite.Begin(SpriteFlags.SortTexture | SpriteFlags.Billboard | SpriteFlags.ObjectSpace);
for(int i = 0; i < n.numNebulas; i++)
{
nebulaSprite.Transform = // Matrix.RotationYawPitchRoll(angle, angle, angle) *
Matrix.Scaling(n.Scale, n.Scale, n.Scale) *
Matrix.Translation(Vector3.Add(translation, n.Positions));
Rectangle texStats = new Rectangle(0, 0, textureInfo[n.textureIndex].Width, textureInfo[n.textureIndex].Height);
nebulaSprite.Draw(nebulaTextures[n.textureIndex],
translation, n.Positions,
Color.White.ToArgb());
}
nebulaSprite.End();