Project topic about the software engineer, Study Guides, Projects, Research of Computer science

A record of practical works done by a student in the college laboratory for the course GAME PROGRAMMING for the partial fulfillment of Fifth Semester of BSc CS during the academic year 2023-2024. It includes a list of topics covered, code snippets, and outputs for each practical work. The document can be useful for students studying game programming in BSc CS and interested in DirectX 11 and C# programming.

Typology: Study Guides, Projects, Research

2022/2023

Available from 09/28/2023

tycs-545-aman-sahu
tycs-545-aman-sahu 🇮🇳

5 documents

1 / 93

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MALAD KANDIVLI EDUCATION SOCIETY’S
NAGINDAS KHANDWALA COLLEGE OF COMMERCE,
ARTS & MANAGEMENT STUDIES & SHANTABEN NAGINDAS
KHANDWALA COLLEGE OF SCIENCE
MALAD [W], MUMBAI 64
(EMPOWERED AUTONOMOUS)
(Reaccredited ‘A’ Grade by NAAC)
(AFFILIATED TO UNIVERSITY OF MUMBAI)
(ISO 9001:2015)
CERTIFICATE
Name: Mr./Ms. AMAN SAHU
Roll No: 545 Programme: BSc CS Semester: V
This is certified to be a bonafide record of practical works done by
the above student in the college laboratory for the course GAME
PROGRAMMING for the partial fulfillment of Fifth Semester of
BSc CS during the academic year 2023-2024.
The journal work is the original study work that has been duly
approved in the year 2023-2024 by the undersigned.
External Examiner Mr. Ashish Modi
(Subject-In-Charge)
Date of Examination: (College Stamp)
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d

Partial preview of the text

Download Project topic about the software engineer and more Study Guides, Projects, Research Computer science in PDF only on Docsity!

MALAD KANDIVLI EDUCATION SOCIETY’S

NAGINDAS KHANDWALA COLLEGE OF COMMERCE,

ARTS & MANAGEMENT STUDIES & SHANTABEN NAGINDAS

KHANDWALA COLLEGE OF SCIENCE

MALAD [W], MUMBAI – 64

(EMPOWERED AUTONOMOUS)

(Reaccredited ‘A’ Grade by NAAC)

(AFFILIATED TO UNIVERSITY OF MUMBAI)

(ISO 9001:2015)

CERTIFICATE

Name: Mr./Ms. AMAN SAHU

Roll No: 545 Programme : BSc CS Semester : V

This is certified to be a bonafide record of practical works done by

the above student in the college laboratory for the course GAME

PROGRAMMING for the partial fulfillment of Fifth Semester of

BSc CS during the academic year 2023 - 2024.

The journal work is the original study work that has been duly

approved in the year 2023 - 2024 by the undersigned.

External Examiner Mr. Ashish Modi

(Subject-In-Charge)

Date of Examination: (College Stamp)

Subject: GAME PROGRAMMING Class: T. Y. BSc. CS

INDEX

Sr. No. Date Topic Sign 1 03/07/2023 Setup DirectX 11, Window Framework and Initialize Direct3D Device 2 03/07/2023 Buffers, Shaders and HLSL (Draw a triangle using Direct3D 11) 3 28/07/2023 Texturing^ (Texture^ the^ Triangle^ using^ Direct 3D^ 11) 4 28/07/2023 Lightning (Programmable Diffuse^ Lightning using Direct3D 11 - Triangle) 5 31/07/2023 Loading^ models^ into^ DirectX 11^ and^ rendering. 6 14/08/2023 Programmable Diffuse Lightning on Rectangle using Direct3D 11 7 14/08/2023 Texture^ the Rectangle using^ Direct^ 3D^11 8 14/08/2023 Draw^ a^ Rectangle^ using^ Direct3D 11 9 21/08/2023 Implementing 2D UFO 10 28/08/2023 Implementing Space Shooter 11 11/09/2023 Implementing Roll Ball

Right Click on properties Click on open click on build Select Platform Target and Select x86. Step 2:- Click on View Code of Form 1.

Step 3:- Go to Solution Explorer, right click on project name, and select Add Reference, Click on Browser and select the given .dll files which are "Microsoft.DirectX.Direct3D", and "Microsoft.DirectX.DirectX3DX".

Step 5: 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 prac_ { public partial class Form1 : Form { Microsoft.DirectX.Direct3D.Device device; public Form1() { InitializeComponent(); InitDevice(); } public 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 Render() { device.Clear(ClearFlags.Target, Color.Orange, 0, 1); device.Present(); } private void Form1_Paint(object sender, PaintEventArgs e) { Render(); } } }

Output:-

device.EndScene(); device.Present(); } private void Form1_Paint(object sender, PaintEventArgs e) { Render(); } } } Output:-

Practical 3 Aim:- Programmable Diffuse Lightning 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; using System.Drawing.Design; namespace Pract { public partial class Form1 : Form { private Microsoft.DirectX.Direct3D.Device device; private CustomVertex.PositionTextured[] vertex = new CustomVertex.PositionTextured[3]; private Texture texture; public Form1() { InitializeComponent(); InitDevice(); } public void InitDevice() { PresentParameters pp = new PresentParameters(); pp.Windowed = true; pp.SwapEffect = SwapEffect.Discard; device = new Device(0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, pp); 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,20), new Vector3(),new Vector3(0,1,0)); device.RenderState.Lighting = false; vertex[0] = new CustomVertex.PositionTextured(new Vector3(0,0,0),0,0); vertex[1] = new CustomVertex.PositionTextured(new Vector3(5,0,0),0,1); vertex[2] = new CustomVertex.PositionTextured(new Vector3(0,5,0),1,-1);

Practical 4 Aim:- Implement Diffusion. 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 Pract { public partial class Form1 : Form { Microsoft.DirectX.Direct3D.Device device; private CustomVertex.PositionNormalColored[] vertex = new CustomVertex.PositionNormalColored[3]; public Form1() { InitializeComponent(); InitDevice(); } public void InitDevice() { PresentParameters pp = new PresentParameters(); pp.Windowed = true; pp.SwapEffect = SwapEffect.Discard; device = new Device(0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, pp); 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, 10), new Vector3(), new Vector3(0, 1, 0)); vertex[0] = new CustomVertex.PositionNormalColored(new Vector3(0, 1, 1), new Vector3(1, 0, 1), Color.Red.ToArgb()); vertex[1] = new CustomVertex.PositionNormalColored(new Vector3(-1, - 1, 1), new Vector3(1, 0, 1), Color.Red.ToArgb()); vertex[2] = new CustomVertex.PositionNormalColored(new Vector3(1, - 1, 1), new Vector3(-1, 0, 1), Color.Red.ToArgb());

device.RenderState.Lighting = true; device.Lights[0].Type = LightType.Directional; device.Lights[0].Diffuse = Color.Plum; device.Lights[0].Direction = new Vector3(0.8f, 0, - 1); device.Lights[0].Enabled = true; } private void Render() { device.Clear(ClearFlags.Target, Color.CornflowerBlue, 0, 1); device.BeginScene(); device.VertexFormat = CustomVertex.PositionNormalColored.Format; device.DrawUserPrimitives(PrimitiveType.TriangleList, vertex.Length / 3, vertex); device.EndScene(); device.Present(); } private void Form1_Paint(object sender, PaintEventArgs e) { Render(); } } } Output:-

device.Clear(ClearFlags.Target, Color.CornflowerBlue, 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.Blue); font.DrawText(s, "nagindas Khandwala Shantanu 522", new Point(0, 0), Color.White); s.End(); } device.EndScene(); device.Present(); } private void Form1_Paint(object sender, PaintEventArgs e) { Render(); } } } Output:-

Practical 6 Aim:- Draw a Rectangle Using DirectX3D 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 Pract { public partial class Form1 : Form { Microsoft.DirectX.Direct3D.Device device; public Form1() { InitializeComponent(); InitDevice(); } public 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 Render() { CustomVertex.TransformedColored[] vertexes = new CustomVertex.TransformedColored[6]; vertexes[0].Position = new Vector4(100, 100, 0, 1); vertexes[0].Color = System.Drawing.Color.FromArgb(255, 0, 0).ToArgb(); vertexes[1].Position = new Vector4(400, 100, 0, 1); vertexes[1].Color = System.Drawing.Color.FromArgb(0, 255, 1).ToArgb(); vertexes[2].Position = new Vector4(400, 300, 0, 1); vertexes[2].Color = System.Drawing.Color.FromArgb(1, 0, 255).ToArgb(); vertexes[3].Position = new Vector4(400, 300, 0, 1); vertexes[3].Color = System.Drawing.Color.FromArgb(255, 0, 0).ToArgb(); vertexes[4].Position = new Vector4(100, 300, 0, 1); vertexes[4].Color = System.Drawing.Color.FromArgb(20, 255, 0).ToArgb(); vertexes[5].Position = new Vector4(100, 100, 0, 1); vertexes[5].Color = System.Drawing.Color.FromArgb(255, 0, 255).ToArgb();

Practical 7 Aim:- Texturing the Rectangle using DirectX 3D. Code:- using System.Collections.Generic; using System.ComponentModel; using System.Data; using System; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; using System.Drawing.Design; namespace Pract { public partial class Form1 : Form { private Microsoft.DirectX.Direct3D.Device device; private CustomVertex.PositionTextured[] vertex = new CustomVertex.PositionTextured[6]; private Texture texture; public Form1() { InitializeComponent(); InitDevice(); } public void InitDevice() { PresentParameters pp = new PresentParameters(); pp.Windowed = true; pp.SwapEffect = SwapEffect.Discard; device = new Device(0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, pp); 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, 20), new Vector3(), new Vector3(0, 1, 0)); device.RenderState.Lighting = false; } private void Render() { vertex[0] = new CustomVertex.PositionTextured(new Vector3(0, 2, 1), 0, 0); vertex[1] = new CustomVertex.PositionTextured(new Vector3(0, - 2, 1), 0, 1); vertex[2] = new CustomVertex.PositionTextured(new Vector3(2, - 2, 1), - 1, 1);

vertex[3] = new CustomVertex.PositionTextured(new Vector3(2, - 2, 1), 0, 0); vertex[4] = new CustomVertex.PositionTextured(new Vector3(2, 2, 1), 0, 1); vertex[5] = new CustomVertex.PositionTextured(new Vector3(0, 2, 1), - 1, 1); texture = new Texture(device, new Bitmap("D:\ 522 \GP\GP\practical5\3Dimage.jpg") , 0, Pool.Managed); device.Clear(ClearFlags.Target, Color.Orange, 0, 1); device.BeginScene(); device.SetTexture(0, texture); device.VertexFormat = CustomVertex.PositionTextured.Format; device.DrawUserPrimitives(PrimitiveType.TriangleList, vertex.Length / 3, vertex); device.EndScene(); device.Present(); } private void Form1_Paint(object sender, PaintEventArgs e) { Render(); } } } Output:-