public Bone(GraphicsDevice graphicsDevice, Bone parent, string name, BoneType type, Vector3 size, Vector3 center) { this.parent = parent; this.name = name; this.type = type; cube = new CubePrimitive(graphicsDevice, size, center); transform = Matrix.CreateScale(new Vector3(1f)) * Matrix.CreateFromQuaternion(Quaternion.Identity) * Matrix.CreateTranslation(Vector3.Zero); localTransform = transform; }
public Renderer(GraphicsDevice device) { _bufferedRenderCommandsA = new List <RenderCommand>(); _bufferedRenderCommandsB = new List <RenderCommand>(); _updatingRenderCommands = _bufferedRenderCommandsA; _renderComandsReady = new ManualResetEvent(false); _renderActive = new ManualResetEvent(false); _renderCompleted = new ManualResetEvent(true); _cubePrimitive = _cubePrimitive ?? new CubePrimitive(device); }
public Renderer(GraphicsDevice device) { _bufferedRenderCommandsA = new List<RenderCommand>(); _bufferedRenderCommandsB = new List<RenderCommand>(); _updatingRenderCommands = _bufferedRenderCommandsA; _renderComandsReady = new ManualResetEvent(false); _renderActive = new ManualResetEvent(false); _renderCompleted = new ManualResetEvent(true); _cubePrimitive = _cubePrimitive ?? new CubePrimitive(device); }
private void MonoGameControl_Loaded(object sender, MerjTek.WpfIntegration.GraphicsDeviceEventArgs e) { // Because this same event is hooked for all 4 controls, we check if the Stopwatch // is running to avoid loading our content 4 times. if (!watch.IsRunning) { // Create our 3D cube object cube = new CubePrimitive(e.GraphicsDevice); // Start the watch now that we're going to be starting our draw loop watch.Start(); } }
protected override void LoadContent() { // Initialize our render cube renderCube = new CubePrimitive(graphics.GraphicsDevice); }
public Renderer(GraphicsDevice device) { _updatingRenderCommands = new List <RenderCommand>(); _concurrentRenderCommandsThatRepresentAFrame = new ConcurrentQueue <RenderCommand[]>(); _cubePrimitive = _cubePrimitive ?? new CubePrimitive(device); }
public Renderer(GraphicsDevice device) { _updatingRenderCommands = new List<RenderCommand>(); _concurrentRenderCommandsThatRepresentAFrame = new BlockingCollection<RenderCommand[]>(); _cubePrimitive = _cubePrimitive ?? new CubePrimitive(device); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here // TODO test Animation3D animation = XmlImporter.Instance.import("../../test.xml"); XmlExporter.Instance.export("../../output.xml", animation); model = new Actor(GraphicsDevice); model.setCurAnimation(animation); cube = new CubePrimitive(GraphicsDevice, new Vector3(1, 1, 1), new Vector3(0.0f, 0.0f, 0.0f)); plane = new PlanePrimitive(GraphicsDevice); camera.Center = new Vector3(0, 0, 0); camera.Distance = 500; }
public Renderer(GraphicsDevice device) { _renderCommands = new List <RenderCommand>(); _cubePrimitive = new CubePrimitive(device); }
public Renderer(GraphicsDevice device) { _renderCommands = new List<RenderCommand>(); _cubePrimitive = new CubePrimitive(device); }
protected override void Initialize() { kinectSensor = new Runtime(); // kinectSensor.Initialize(RuntimeOptions.UseColor); spriteBatch = new SpriteBatch(GraphicsDevice); kinectRGBVideo = new Texture2D(GraphicsDevice, 640, 480); cube = new CubePrimitive(graphics.GraphicsDevice); cubeXPosition = 5; cubeyYPosition = 5; cubeTranslation = Matrix.CreateTranslation(cubeXPosition, cubeyYPosition, 5); currentPrimitive = new SpherePrimitive(graphics.GraphicsDevice, .25f, 5); kinectSensor.Initialize(RuntimeOptions.UseColor | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor); kinectSensor.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.ColorYuv); kinectSensor.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(NuiSkeletonFrameReady); kinectSensor.VideoFrameReady += new EventHandler<ImageFrameReadyEventArgs>(KinectSensorVideoFrameReady); graphics.PreferredBackBufferWidth = 640; graphics.PreferredBackBufferHeight = 480; graphics.ApplyChanges(); view = Matrix.CreateLookAt(new Vector3(0, 0, 40), new Vector3(0, 0, -100), Vector3.Up); projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, GraphicsDevice.Viewport.AspectRatio, 1.0f, 100); base.Initialize(); }
/// <summary> /// LoadContent はゲームごとに 1 回呼び出され、ここですべてのコンテンツを /// 読み込みます。 /// </summary> protected override void LoadContent() { // 新規の SpriteBatch を作成します。これはテクスチャーの描画に使用できます。 spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: this.Content クラスを使用して、ゲームのコンテンツを読み込みます。 //tex1 = Content.Load<Texture>(string assetName); // assetNameで示されるのがコンテンツ? //myTexture = Content.Load<Texture2D>("XNAContentTestBMPPhoto1"); myTexture = Content.Load<Texture2D>("Ane1"); //tex1 = Content.Load<Texture>("XNAContentTestBMPPhoto1"); var p1 = new CubePrimitive(GraphicsDevice); p1.setTexture(myTexture); primitives.Add(p1); //primitives.Add(new CubePrimitive(GraphicsDevice)); wireFrameState = new RasterizerState() { FillMode = FillMode.WireFrame, CullMode = CullMode.None, }; }