Design your 3d environment

Assignment Help C/C++ Programming
Reference no: EM131513021

Introduction

Particle systems are used in games, movies, etc. to depict phenomena such as clouds, dust, fireworks, fire, explosions, water flow, sand, insects, wildebeests, etc. Once you know what they are, you can't stop seeing them. We think of particle systems as being created digitally, like you will be doing. But recently, one was create analogly, like with LEDs attached to pigeons. (No, really.)
A bit of particle history, particle systems were first seen in the Star Trek II: The Wrath of Khan Genesis Demo.

To make a particle system work, you manipulate a collection of many 3D particles to exhibit some behavior. ( Look here for more information.)

In this project, you will use OpenCL and OpenGL together to make a cool particle system. (The degree of cool- ness is up to you.)

Requirements:

1. Design your 3D environment. The particles need to start from somewhere. Where should that be? The particles need to start with initial velocities. What should those be?

Your 3D environment needs to have at least two "bumpers" in it for the particles to bounce off of. Each bumper needs to be geometrically designed such that, given a particle's XYZ, you can quickly tell if that particle is inside or outside the bumper. To get the bounce right, each bumper must be able to know its outward-facing surface normal everywhere.

Let's face it. Spheres are computationally "nice". In computer graphics, we love spheres. It is fast and easy to tell if something is inside or outside a sphere. Determining a normal vector for a point on the surface of a sphere is even easier.

It is OK to assume that the two bumpers are separate from each other, that is, a particle cannot be colliding with both at the same time.

2. Create an OpenGL buffer object to hold the particles' XYZW positions as an array-of-structures. Create an OpenGL buffer object to hold the particles' RGBA colors as an array-of-structures.

Create a C++ array-of-structures to hold the particles' XYZ velocities.
(OpenGL buffer objects are used for position and color, but not velocity. This is because OpenGL will need to use positions and colors in the drawing, but not the velocities.)

3. Determine good starting values for all 3 data structures.
For the position and color buffers, use glMapBuffer( ) to send the values directly to the GPU. The velocity array is a C++ array-of-structures, so just fill it using C++ code.

4. Create two OpenCL buffers from the position and color OpenGL buffers using calls to clCreateFromGLBuffer( ). You don't need to transmit the data to these OpenCL buffers -- it is already there in the OpenGL buffers that they are now linked to.

5. For the velocity array, create an OpenCL buffer using clCreateBuffer and transmit the C++ array-of- structures to it like you've done before using clEnqueueWriteBuffer( ).

6. Decide on a time step, DT. Your .cl program will need to know about it. You can pass it in, or hard code it.

7. Create a .cl OpenCL kernel that will advance all of the particles by the timestep DT. The sample code shows giving the .cl program access to the particles' positions and velocities. You will need to use these, and will need to update them.

8. Your OpenCL .cl program must also handle the bounces off of your bumpers. Be sure to draw these bumpers in your .cpp program so that you can see where they are. Again, spheres are "nice".

9. The sample code shows giving the .cl program access to the particles' colors. But, Joe Parallel didn't do anything with these. But, your .cl kernel needs to dynamically change the color of the particles. You could base this on position, velocity, time, bounce knowledge, etc. But, the color of each particle needs to change in some way during the simulation.

Note that OpenGL defines the red, green, and blue components of a color each as a floating-point value between 0. and 1.

10. Leave the local work-group size at some fixed value. You can pull this out of your experience with Project #6, or you can experiment with the timing. Vary the total number of particles and measure the performance using units that make sense. Following our class tradition of inventing our own giga-cool-sounding units of measure, Joe Parallel used "Particles Per Second", or "MegaParticles Per Second", or "GigaParticles Per Second".

11. Make a table and a graph of Performance versus Total Number of Particles

12. Turn into teach, individually, not in a .zip file:
1. Your source code (.cpp and .cl). Give your .cl file a name that is some variation on your name or login. (See below.)
2. Your executable
3. Your commentary in a PDF file.

13. Your commentary PDF should include:

1. What machine you ran this on

2. What dynamic thing did you do with the particle colors

3. Include at least one screen capture image of your project in action

4. Show the table and graph

5. What patterns are you seeing in the performance curve?

6. Why do you think the patterns look this way?

7. What does that mean for the proper use of GPU parallel computing?

Attachment:- Advancing a Particle by DT.rar

Verified Expert

In this assignment we have studied particle system.Here we have developed system in open GL .in this system we develop particle with different color.Here particle are move with certain velocity . Here we have also studied performance graph and table and what is use of GPS.

Reference no: EM131513021

Questions Cloud

Calculate the current price of bpafree : After that, the dividend is expected to grow 4% annually forever. If the required return is 10%, calculate the current price of BPAFree.
What is the current price : After that, revenue and profitability will decline and the dividend will decline by 4% per year forever.
Create appropriate frameworks for network implementation : MN621 Advanced Network Design Assessment. Create appropriate frameworks and standards for network implementation
Current value of one share : What is the current value of one share of this stock if the required rate of return is 6.4 percent?
Design your 3d environment : CS 475/575 -- Spring Quarter 2017 - OpenCL / OpenGL Particle System - Design your 3D environment. The particles need to start from somewhere.
Explain the financial environment at genesis energy : Describe and Explain the financial environment at Genesis Energy by using ratio analysis of company. Explain two ways Genesis Energy can improve its strategy.
American bankruptcy institute : Write an essay after listening to the most recent Press Briefing on the American Bankruptcy Institute's website.
What is? unida unlevered cost of? capital : a. What is? Unida's unlevered cost of? capital? b. What is? Unida's after-tax debt cost of? capital?
Discuss and critically analyse the court : HI6028 Taxation, Theory, Practice & Law - Discuss and critically ANALYSE the court/tribunal decision and the reason for the decision in view of the corresponding Act (e.g. GST, FBT, etc)

Reviews

inf1513021

6/22/2017 5:42:20 AM

100% magnificent. I was having so much inconvenience and this helped me breeze through my assignments and acquire trust in this subject. Thanks to you for such an extent! I will definitely pass this site on to every one of my companions! Good one, thanks once again...

inf1513021

6/22/2017 5:36:00 AM

This is complete project, download it here from link. /Assignments/7A_assignment.zip I just got an email from professor: You need to create a flowchart and write a paragraph explain what is going on for each part. Please send me this ASAP. I got it..please tell expert to explain to me how to run the code

len1513021

5/31/2017 6:18:44 PM

Feature Points Convincing particle motion 10 Bouncing from at least two bumpers 30 Dynamic color changes 30 Performance table and graph 20 Commentary in the PDF file 30 Potential Total 120 Decide on a time step, DT. Your .cl program will need to know about it. You can pass it in, or hard code it.

len1513021

5/31/2017 6:18:23 PM

Please, please, please: 1. Name your .cl file to be some unique variation on your name or login 2. Put your name in the graphics window title bar So, for Joe Parallel, the file name would be something like jparallel.cl The naming of the .cl file must happen during development because that file name is hard-coded into your .cpp program. There is a constant character string near the top of the program called WINDOWTITLE where you set the string that goes in the graphics window title bar. Change Joe Parallel to your name.

Write a Review

C/C++ Programming Questions & Answers

  Write the definitions of the functions

Write the definition of the function setZero that initializes any one-dimensional array of type int to 0.

  Write a program to calculate students average test scores

Write a program to calculate students average test scores

  Complete the leadership in action case study

Complete the Leadership in Action case study for Lehman Brothers on page 276-277 in your textbook.

  Implement class bankacct for bank usq

Implement class BankAcct, for Bank of USQ, using bankacct.cpp and bankacct.h and Implement an application bankUSQ_app.cpp

  Write a program in which set up a douhly-subscripted array

Write a program in which you set up a douhly-subscripted array to store each character in the wit. Ube ;old loops, and the most efficient  statements to do it. Include documentation (comment stmts.) in your program.

  Local diner that allows customers to see the diner''s menu

Design a program to be used for a small local diner that allows customers to see the diner's menu and then make their meal selections using the program.The program will also calculate and print an itemized bill.

  Define a function named average grade

Define a function named average grade. This function returns a double and has four double arguments, testi, test2, test3, test4. The return value should be the average, or arithmetic mean of the four arguments.

  Write a for loop that adds the integers

Write a for loop that adds the integers between lo and hi (inclusive), and stores the result in result.

  Write a method called check value

Get input for the starting number (assume important statement is already present)

  Write a program that declares three one dimensional

Write a program that declares three one dimensional arrays named miles, gallons, and mpg . Each array should be declared in main( ) and should be capable of holding ten double

  Program to input the salary and output payable tax

Prepare a C program to input the salary and output payable tax using the given information

  Evaluate its employees four times a year at the end of year

The data will be validated and saved to an output file,"datainput" . this program will use five arrays to grater manupliate and store the data.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd