Example #1
0
        private static void display3DObjects(GameWorld.World world, Player player, Character doNotDisplay, Effect effectToUse, DisplayParameters displayParameters)
        {
            effect.Parameters["xOpacity"].SetValue(1f);

            world.displayActors(device, effectToUse, doNotDisplay);
            world.displayIslands(device, effectToUse, new BoundingFrustum(viewMatrix * getPerspectiveMatrix(1000)), displayParameters);
            player.display3D();
            foreach (AnimatedBodyPartGroup group in CharactersForThisFrame)
            {
                group.draw(device, effectToUse);
            }
            CharactersForThisFrame.Clear();


            effect.Parameters["xProjection"].SetValue(getPerspectiveMatrix(2000));
            sky.draw(device, effectToUse, viewMatrix, getPerspectiveMatrix(2000), player.getCameraLoc());
            effect.Parameters["xProjection"].SetValue(getPerspectiveMatrix(1000));
            ocean.draw(device, viewMatrix, getPerspectiveMatrix(1000), player.getCameraLoc(), ambientBrightness);

            effect.CurrentTechnique = effect.Techniques["Instanced"];
            WorldMarkupHandler.drawCharacters(device, effect);
            effect.CurrentTechnique = effect.Techniques["Colored"];
        }