Question: The assignment is a simple exercise to implement a simpler Scene graph using as much parallelism as possible in cuda c + + language. Given
The assignment is a simple exercise to implement a simpler Scene graph using as much parallelism as
possible in cuda c language. Given multiple images as matrices meshes in grayscale along with their initial positions, a
multiset of translations, and their relationship to one another, you are to cast a scene of given dimensions.
The initial positions of the images are presented as coordinates denoting the position where the
top most, left most pixel of the image would be placed in the scene matrix.
The relationships between the images are represented by an edge list. Note that an edge from image to
image would mean that they translate together. In other words, if image is translated in some direction
on the D plane, image would have to be translated in the same direction by the same amount. However,
if image is moved, this need not be reflected in
The translations here are transitive, ie if there is an edge from to and another edge from to if
is moved, the movement will have to be reflected in as well. The Test cases will assure that the resultant
graph formed by the edges is a tree. The tree will always be rooted at
While the images move, overlaps may happen. On such occasions, the more opaque matrix shall be
visible in the overlapping regions opacity of matrices are provided along with the matrix descriptions in the
test cases The opacity values are guaranteed to be unique per mesh Input and Output Format :
Input Format :
In each testcase,
The first line contains the number of meshes.
The second line contains the size of the scene
This is followed by descriptions for the meshes respectively. Each of the description,
Starts with the size of the mesh along and directions
followed by the starting coordinates of the mesh.
The next line has the opacity of the mesh.
The next lines have integers, together defining a mesh
The description of meshes is followed by the description of edges. The edges description,
starts with number of edges
Followed by E lines. Each line is of the format which represents an edge from mesh to
Next follows the description of translations to be applied. The description,
Starts with the number of translations followed by lines, one for each translation.
Each of the lines has, NCA, where is the mesh number on which the translation has to be
applied, is the translation command, is the amount.
The command of a translation can be of the following type:
Table : Translation commands
Transaltion Command Transaltion
UP
DOWN
LEFT
RIGHT
Output Format :
Print out the resultant Scene as an matrix. lines, each containing integers
Sample Test Case :
Sample Input :
Sample Output :
Constraints :
and
and
summation of across all meshes
opacity of a mesh
Starter code ie main function is provided in the image Considering this main function write your code.please use cuda c language
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
