-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSky.cs
More file actions
32 lines (28 loc) · 994 Bytes
/
Sky.cs
File metadata and controls
32 lines (28 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Boatanator
{
class Sky
{
Texture2D tex;
Sphere sphere;
public void Load(GraphicsDevice decive, ContentManager content)
{
tex = content.Load<Texture2D>("skyhalf");
sphere = Sphere.CreateHalf(decive, 15, 7, v=> new VertexPositionTexture(v.Position, new Vector2(v.TextureCoordinate.X , 1-v.TextureCoordinate.Y)));
//sphere = Sphere.Create(decive);
sphere.effect.Texture = tex;
sphere.effect.TextureEnabled = true;
}
public void Draw(Camera cam)
{
sphere.effect.World = Matrix.CreateScale(1000)*Matrix.CreateTranslation(cam.Position.X, -1, cam.Position.Z);
sphere.Draw(cam.View, cam.Projection);
}
}
}