Game Pro Practical -------- Microsoft office 2021 Professional product Key activate using CMD Cammand by Sewestian
Practical No. 1
AIM: Initialising Windows Form Using Direct X.
Code:
using System; using
System.Collections.Generic;
using System.ComponentModel;
using System.Data; using
System.Drawing; using
System.Text; using
System.Windows.Forms; using
Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
namespace pract1
{
public partial class Form1 : Form
{
Microsoft.DirectX.Direct3D.Device device;
public Form1()
{
InitializeComponent();
InitDevice();
}
private void InitDevice()
{
PresentParameters pp = new PresentParameters();
pp.Windowed = true; pp.SwapEffect =
SwapEffect.Discard;
device = new Device(0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, pp);
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
render();
}
private void render()
{
device.Clear(ClearFlags.Target, Color.Orange, 0, 1);
device.Present();
}
}
}
Practical no 2
Practical 2-
Aim:- Draw Transformed coloured Triangle using DirectX.
code:-
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Pract2
{
public partial class Form1 : Form
{
Microsoft.DirectX.Direct3D.Device device;
public Form1()
{
InitializeComponent();
InitDevice();
}
private void InitDevice()
{
PresentParameters pp = new PresentParameters();
pp.Windowed = true;
pp.SwapEffect = SwapEffect.Discard;
device = new Device(0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, pp);
}
public void Render()
{
CustomVertex.TransformedColored[] vertexes = new
CustomVertex.TransformedColored[3];
vertexes[0].Position = new Vector4(200, 100, 0, 1.0f);//first point
vertexes[0].Color = System.Drawing.Color.FromArgb(0, 255, 0).ToArgb();
vertexes[1].Position = new Vector4(200, 300, 0, 1.0f);//second point
vertexes[1].Color = System.Drawing.Color.FromArgb(0, 0, 255).ToArgb();
vertexes[2].Position = new Vector4(90, 200, 0, 1.0f);//third point
vertexes[2].Color = System.Drawing.Color.FromArgb(255, 0, 0).ToArgb();
device.Clear(ClearFlags.Target, Color.Orange, 0, 1);
device.BeginScene();
device.VertexFormat = CustomVertex.TransformedColored.Format;
device.DrawUserPrimitives(PrimitiveType.TriangleList, 1, vertexes);
device.EndScene();
device.Present();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Form1_Paint_1(object sender, PaintEventArgs e)
{
Render();
}
}
}
practical no. 3
Aim:- Texturing (Texture the Triangle using Direct 3D 11)
CODE:-
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing; using
System.Text;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
namespace Pract3
{
public partial class Form1: Form
{
Microsoft.DirectX.Direct3D.Device device;
public Form1()
{
InitializeComponent();
InitDevice();
}
private void InitDevice()
{
PresentParameters pp = new PresentParameters();
pp.Windowed = true; pp.SwapEffect =
SwapEffect. Discard;
device = new Device(0, DeviceType.Hardware, this, CreateFlags.Hardware VertexProcessing, pp);
}
{
}
private void Form1_Load(object sender, EventArgs e)
private void Form1_Paint(object sender, PaintEventArgs e)
{
Render();
}
private void Render()
{
CustomVertex. Position Textured[] vertexes = new
CustomVertex.Position Textured [3];
device.Transform.Projection = Matrix.Perspective FovLH(3.14f/4, device. Viewport.Width / device.Viewport. Height, 1f, 1000f);
device.Transform.View Matrix.LookAtLH(new Vector3(0, 0, 5), new
=
Vector3(), new Vector3(0, 1, 0)); device.RenderState.Lighting = false;
vertexes[0] = new CustomVertex.PositionTextured(new Vector3(0, 1, 1), 0, 0);
vertexes[1] = new Custom Vertex. Position Textured (new Vector3(-1, -1, 1), -1, 0);
vertexes[2] = new CustomVertex. Position Textured(new Vector3(1, -1, 1), 0, -1);
Texture texture = new Texture(device, new
Bitmap("C:/Users/Admin/Downloads/texture.jpg"),0, Pool.Managed);
device.Clear(ClearFlags.Target, Color.Orange,0,1);
device.BeginScene(); device.SetTexture(0, texture);
device.VertexFormat = Custom Vertex. Position Textured.Format;
device. DrawUserPrimitives(PrimitiveType.TriangleList, 1, vertexes);
device.EndScene();
device.Present();
}
}
}
Note
Go To Browser Type Texture Images Select Any Texture Image Of Your Choice Save the image in following way (save Select Your Project Folder (Practical3) Practical3 Now create A New Folder name it As Image inside this Folder Save Your Texture Image)
Now in Visual Studio Go To File Open Folder now From this go to the Folder (Image) where You
have Saved Your Texture Image copy The Path and Paste it in texture = new Texture device, new Bitmap(@"C:\Users\Desktop\Gameprog\practical3\practical3\images\texture.jpg"), 0,
Pool.Managed);
Add @Symbol at Beginning of path or else Add "\\" in path
Practical no. 4 & 5
Aim 4 and 5 same
Practical 4-
Aim :- Programmable Diffuse Lightening using Direct3D and
Practical 5 -
Aim : - Lighting (Programmable Specular Lighting using Direct 3D11)
code:-
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
namespace Pract5
{
public partial class Form1 : Form
{
Microsoft.DirectX.Direct3D.Device device;
private CustomVertex.PositionNormalColored[] vertex = new
CustomVertex.PositionNormalColored[3];
public Form1()
{
InitializeComponent();
InitDevice();
}
private void InitDevice()
{
PresentParameters pp = new PresentParameters();
pp.Windowed = true;
pp.SwapEffect = SwapEffect.Discard;
device = new Device(0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, pp);
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Render();
}
private void Render()
{
CustomVertex.PositionNormalColored[] vertexes = new
CustomVertex.PositionNormalColored[3];
device.Transform.Projection = Matrix.PerspectiveFovLH(3.14f / 4, device.Viewport.Width /
device.Viewport.Height, 1f, 1000f);
device.Transform.View = Matrix.LookAtLH(new Vector3(0, 0, 5), new
Vector3(), new Vector3(0, 1, 0)); device.RenderState.Lighting = false;
vertexes[0] = new CustomVertex.PositionNormalColored(new Vector3(0, 1, 1), new Vector3(1, 0, 1),
Color.OrangeRed.ToArgb()); vertexes[1] = new
CustomVertex.PositionNormalColored(new Vector3(-1, -1, 1), new Vector3(1, 0, 1),
Color.White.ToArgb()); vertexes[2] = new
CustomVertex.PositionNormalColored(new Vector3(1, -1, 1), new Vector3(-1, 0, 1),
Color.LawnGreen.ToArgb());
device.Lights[0].Type = LightType.Directional;
device.Lights[0].Specular = Color.Plum;
device.Lights[0].Direction = new Vector3(0.8f, 0, -1);
device.Lights[0].Enabled = true;
device.Clear(ClearFlags.Target, Color.Cyan, 0, 1);
device.BeginScene();
device.VertexFormat = CustomVertex.PositionNormalColored.Format;
device.DrawUserPrimitives(PrimitiveType.TriangleList, vertexes.Length / 3, vertexes); device.EndScene();
device.Present();
}
private void Pract5(object sender, EventArgs e)
{
}
}
}
Practical no. 6
AIm:- Loading models into Direct X 11 and Rendering
code :-
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
namespace Pract6
{
public partial class Form1 : Form
{
Microsoft.DirectX.Direct3D.Device device;
Microsoft.DirectX.Direct3D.Font font;
//Microsoft.DirectX.Direct3D.Texture texture;
public Form1()
{
InitializeComponent();
InitDevice();
}
private void InitDevice()
{
PresentParameters pp = new PresentParameters();
pp.Windowed = true;
pp.SwapEffect = SwapEffect.Discard;
device = new Device(0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, pp);
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Render();
}
private void Render()
{
Texture texture = new Texture(device, new
Bitmap("C:/Users/Admin/Downloads/texture.jpg"), 0, Pool.Managed);
System.Drawing.Font f = new System.Drawing.Font("Times New
Roman", 40f, FontStyle.Bold); font = new
Microsoft.DirectX.Direct3D.Font(device, f);
device.Clear(ClearFlags.Target, Color.OrangeRed, 0, 1);
device.BeginScene();
using (Sprite s = new Sprite(device))
{
s.Begin(SpriteFlags.AlphaBlend);
s.Draw2D(texture, new Rectangle(0, 0, 0, 0), new Rectangle(0, 0, device.Viewport.Width,
device.Viewport.Height), new Point(0, 0), 0f, new
Point(0, 0), Color.AliceBlue);
font.DrawText(s, "Game Programming with Direct X tycs", new
Point(40, 175), Color.Green);
s.End(); }
device.EndScene();
device.Present();
}
}
}
Practical no. 7
aim :-write a program for add property of add forces and rigidbody
code :-
Practical No 7
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class move : MonoBehaviour {
public float xForce = 10.0f;
public float zForce = 10.0f;
public float yForce = 500.0f;
//use this for initialization
void Start () {
}
//Update is called once per frame
void Update () {
//this is for x axis' movement
float x = 0.0f;
if (Input.GetKey (KeyCode.A)) {
x = x - xForce;
}
if (Input.GetKey (KeyCode.D)) {
x = x + xForce;
}
//this is for z axis' movement
float z = 0.0f;
if (Input.GetKey (KeyCode.S)) {
z = z - zForce;
}
if (Input.GetKey (KeyCode.W)) {
z = z + zForce;
}
//this is for z axis' movement
float y= 0.0f;
if (Input.GetKeyDown (KeyCode.Space)) {
y = yForce;
}
GetComponent<Rigidbody> ().AddForce (x, y, z);
}
}
Practical no. 8
aim:- update once per frame per second/rate
Practical 8:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Rotate : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.Rotate(new Vector3(15,30,45)*Time.deltaTime);
}
}
Practical no. 9
aim:- write a program for speed, rigidbody
Practical 9:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Move : MonoBehaviour
{
public float speed;
private Rigidbody rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
float moveHorizontal=Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 mov = new Vector3(moveHorizontal,0.0f,moveVertical);
rb.AddForce(mov*speed);
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("PickUp"))
{
other.gameObject.SetActive(false);
}
}
void Update()
{
}
}
Practical No. 10
aim:- write a program for counting and displaying text of count
Practical 10:
Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Roll : MonoBehaviour
{
public float speed;
private Rigidbody rb;
private int count;
public Text CountText;
public Text WinText;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
count = 0;
setCountText();
WinText.text= "";
}
void FixedUpdate()
{
float moveHorizontal=Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 mov = new Vector3(moveHorizontal,0.0f,moveVertical);
rb.AddForce(mov*speed);
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("PickUp"))
{
other.gameObject.SetActive(false);
count =count + 1;
setCountText();
}
}
void setCountText()
{
CountText.text = "Count: " + count.ToString();
if (count >= 3)
{
WinText.text = "You Win";
}
}
void Update()
{
}
}
Micordoft office 2021 activate using CMD Command Prompt.
STEP 1 :- Copy this Command and Run as Adminstrator use in CMD command Prompt then Press this code when you paste in terminal the press enter...
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
cd /d %ProgramFiles%\Microsoft Office\Office16
STEP 2:- Copy and paste in CMD
for /f %x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x"
STEP 3:- Copy and Paste in CMD as Run as Adminstrator For activat Microsft office 2021
cscript ospp.vbs /setprt:1688
cscript ospp.vbs /unpkey:6F7TH >nul
cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH
cscript ospp.vbs /sethst:kms8.MSGuides.com
cscript ospp.vbs /act
NOTE:-
Then Press when you see ACT in last installed character Then press enter for confirming is installed or Not
When you Forget This steps so please refer this link for installing Product Key. Microsoft Office 2021
Link:-
https://buzz2daytech.blogspot.com/2022/04/activate-office-2021-using-cmd.ht cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
Comments
Post a Comment