代写program、代做C++程序设计
- 首页 >> C/C++编程 Installation steps for your laptop:
Install visual studio (2022 community edition is fine)
Latest visual studio is fine
When installing, choose
* Desktop development with C++
* Game development with C++
You don't need to install any other windows SDKs
If you want to use the directx texture tool you can install the old directx sdk from jun 2010:
old DirectX SDK has some good tools that we will use. (when installing, it might give you some
warnings, you can ignore those)
You will be running premake to generate visual studio solutions. They will be for older visual
studio (vs2015) but you can open them in 2022 version just fine.
Install cygwin
For cygwin, just install latest cygwin, default installation
Run cygwin once, it will create the user folder. In cygwin user folder, in .bashrc file (in my case
C:\cygwin\home\Artem\.bashrc) , append these lines to make cygwin handle files with windows
line endings properly(more info):
export SHELLOPTS
set -o igncr
make sure to use notepad++ or something that has good handling of line endings. Don't use
Notepad. Once lines are added, restart cygwin so it reloads with the new file.
Install Autodesk Maya
(use autodesk and free student license)
Note, at the moment the Maya tools for PrimeEngine wont work because of latest maya
versions using Python 3. I am fixing them.
Export PEWorkspace for a fairly shallow folder, like C:\projects. Don't install into a deep folder
and don't have spaces in the path
和一个PrimeEngine的文件包A1
[Task 1] Soldier #1 - Choose Between Waypoints
Add ability to specify more than one next waypoint (up to 3) in waypoint script. Then in code
choose one randomly whenever soldier chooses next waypoint. This should make Soldier #1
have a more randomized movement instead of circling the car.
Task 1 alternative: because we don’t have Maya working yet, what you can do is instead use
existing level and randomly choose either next waypoint specified , or waypoint specified after
next waypoint, effectively skipping one waypoint. This will still give a randomized choice of
where soldier goes next.
[Task 2] Soldier #2 - Tracking New Object
Create a new object type called Target (similar to what is done in first two tutorials). Add ability
to SoldierNPC to turn to the target and play shooting animation
(SoldierNPCAnimationSM::STAND_SHOOT). Trigger this ability on the soldier that goes into idle
(not the soldier that keeps running around the car). Note, it is acceptable to just repurpose
solider object as a target, by adding some parameters so that on code side you could use imrod
mesh instead of solider skinned mesh.
The target should be moving close to soldier. Doesn't really matter what movement pattern it is
(can be circling around soldier) as long as it moves and the soldier keeps turning towards it. Use
imrod mesh for the Target object.
Task 2 Alternative: we have sample code to create imrod mesh straight from code, you can use
that instead of going through process of creating new object through Maya. So you would just
hardcode creating of new object. You can also create SoldierNPC from code directly, if you
want. Creating a simple mesh object and give it some motion is much easier than creating a
soldier npc and changing which mesh it issues. We will discuss in class.
So end result will look like this:
The soldier moves to the point, stops, starts shooting at the target object .
For A2, when creating a target, it is enough to just debug draw a locator.
Just like we draw waypoints you can just debug draw text that says “target” and moves
around.Then the solider needs to aim at that.
Your submission will be a video recording of the results working and text file/commentary on
what was done.A2
In this homework you are going to concentrate on math and optimization. Currently all
renderable objects (s.a. meshes, skinned meshes) are always submitted to graphics pipeline for
rendering. This is quite inefficient considering that objects could be outside of camera view and
could be completely ignored.For this assignment, you will create bounding volumes for objects
and perform a culling test with camera view frustum. So if you have a bounding volume around
a mesh, and it does not intersect with camera frustum, it can be completely ignored. You will do
it for static meshes that are loaded from files.
1) Creating bounding volumes
You will create Axis Aligned Bounding Box around meshes. Note, AABB is axis aligned in local
mesh space, but can take any orientation when mesh is moved around in the world based on
orientation of SceneNode. You need to find where the mesh point information is stored and
analyze all the points to generate AABB
2) Showing bounding volumes
You will need to add helper functions to render a box and in debug renderer, similar to how
transforms are already being rendered for soldiers. This way, we will be able to see how well the
volumes have been generated. You might need to increase static limits of number of lines that
the renderer can handle.
3) Creating Frustum Plane Equations
You will need to create plane equations for camera frustum based on where camera is and
camera's field of view. I suggest having code that can generates plane equations for planes that
are a little closer than they should be, so you could see objects pop off the screen before they
are out of render camera view. This way it will be easy to test if your code is working.
4) Testing bounding volumes
Finally, you will need to use bounding volumes to test with camera view frustum and dismiss the
mesh instances that are not intersecting with camera view frustum.
5) Testing your code
I added code to spawn 100 imrods in ClientCharacterControlGame::initGame(), look for
spawnALotOfMeshes and set it to true to enable.Rendering all of them causes framerate drop. However with bounding volume check, framerate
goes higher. In case you have a monster machine that does not take performance hit rendering
100 imrods, make it a thousand imrods. So if your code works framerate should be almost the
same as running game without ever spawning imrods.
The final version of the assignment in your video should have the planes generated with a little
smaller fov so that we can see objects popping off before they are fully off the screen.
Your submission will be a video with description of how everything is working. Keep a copy of
your workspace with the solution in case we ask to upload it to perforce. Make sure to generate
planes with a smaller fov so we can see objects popping off.
Install visual studio (2022 community edition is fine)
Latest visual studio is fine
When installing, choose
* Desktop development with C++
* Game development with C++
You don't need to install any other windows SDKs
If you want to use the directx texture tool you can install the old directx sdk from jun 2010:
old DirectX SDK has some good tools that we will use. (when installing, it might give you some
warnings, you can ignore those)
You will be running premake to generate visual studio solutions. They will be for older visual
studio (vs2015) but you can open them in 2022 version just fine.
Install cygwin
For cygwin, just install latest cygwin, default installation
Run cygwin once, it will create the user folder. In cygwin user folder, in .bashrc file (in my case
C:\cygwin\home\Artem\.bashrc) , append these lines to make cygwin handle files with windows
line endings properly(more info):
export SHELLOPTS
set -o igncr
make sure to use notepad++ or something that has good handling of line endings. Don't use
Notepad. Once lines are added, restart cygwin so it reloads with the new file.
Install Autodesk Maya
(use autodesk and free student license)
Note, at the moment the Maya tools for PrimeEngine wont work because of latest maya
versions using Python 3. I am fixing them.
Export PEWorkspace for a fairly shallow folder, like C:\projects. Don't install into a deep folder
and don't have spaces in the path
和一个PrimeEngine的文件包A1
[Task 1] Soldier #1 - Choose Between Waypoints
Add ability to specify more than one next waypoint (up to 3) in waypoint script. Then in code
choose one randomly whenever soldier chooses next waypoint. This should make Soldier #1
have a more randomized movement instead of circling the car.
Task 1 alternative: because we don’t have Maya working yet, what you can do is instead use
existing level and randomly choose either next waypoint specified , or waypoint specified after
next waypoint, effectively skipping one waypoint. This will still give a randomized choice of
where soldier goes next.
[Task 2] Soldier #2 - Tracking New Object
Create a new object type called Target (similar to what is done in first two tutorials). Add ability
to SoldierNPC to turn to the target and play shooting animation
(SoldierNPCAnimationSM::STAND_SHOOT). Trigger this ability on the soldier that goes into idle
(not the soldier that keeps running around the car). Note, it is acceptable to just repurpose
solider object as a target, by adding some parameters so that on code side you could use imrod
mesh instead of solider skinned mesh.
The target should be moving close to soldier. Doesn't really matter what movement pattern it is
(can be circling around soldier) as long as it moves and the soldier keeps turning towards it. Use
imrod mesh for the Target object.
Task 2 Alternative: we have sample code to create imrod mesh straight from code, you can use
that instead of going through process of creating new object through Maya. So you would just
hardcode creating of new object. You can also create SoldierNPC from code directly, if you
want. Creating a simple mesh object and give it some motion is much easier than creating a
soldier npc and changing which mesh it issues. We will discuss in class.
So end result will look like this:
The soldier moves to the point, stops, starts shooting at the target object .
For A2, when creating a target, it is enough to just debug draw a locator.
Just like we draw waypoints you can just debug draw text that says “target” and moves
around.Then the solider needs to aim at that.
Your submission will be a video recording of the results working and text file/commentary on
what was done.A2
In this homework you are going to concentrate on math and optimization. Currently all
renderable objects (s.a. meshes, skinned meshes) are always submitted to graphics pipeline for
rendering. This is quite inefficient considering that objects could be outside of camera view and
could be completely ignored.For this assignment, you will create bounding volumes for objects
and perform a culling test with camera view frustum. So if you have a bounding volume around
a mesh, and it does not intersect with camera frustum, it can be completely ignored. You will do
it for static meshes that are loaded from files.
1) Creating bounding volumes
You will create Axis Aligned Bounding Box around meshes. Note, AABB is axis aligned in local
mesh space, but can take any orientation when mesh is moved around in the world based on
orientation of SceneNode. You need to find where the mesh point information is stored and
analyze all the points to generate AABB
2) Showing bounding volumes
You will need to add helper functions to render a box and in debug renderer, similar to how
transforms are already being rendered for soldiers. This way, we will be able to see how well the
volumes have been generated. You might need to increase static limits of number of lines that
the renderer can handle.
3) Creating Frustum Plane Equations
You will need to create plane equations for camera frustum based on where camera is and
camera's field of view. I suggest having code that can generates plane equations for planes that
are a little closer than they should be, so you could see objects pop off the screen before they
are out of render camera view. This way it will be easy to test if your code is working.
4) Testing bounding volumes
Finally, you will need to use bounding volumes to test with camera view frustum and dismiss the
mesh instances that are not intersecting with camera view frustum.
5) Testing your code
I added code to spawn 100 imrods in ClientCharacterControlGame::initGame(), look for
spawnALotOfMeshes and set it to true to enable.Rendering all of them causes framerate drop. However with bounding volume check, framerate
goes higher. In case you have a monster machine that does not take performance hit rendering
100 imrods, make it a thousand imrods. So if your code works framerate should be almost the
same as running game without ever spawning imrods.
The final version of the assignment in your video should have the planes generated with a little
smaller fov so that we can see objects popping off before they are fully off the screen.
Your submission will be a video with description of how everything is working. Keep a copy of
your workspace with the solution in case we ask to upload it to perforce. Make sure to generate
planes with a smaller fov so we can see objects popping off.