Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

(a) Write a WPF program that uses the method in Exercise 32.6 to generate points in a triangle. The user should be able to drag the three triangle vertices, and press buttons to generate either a single point or 100 points, each of which should be displayed as a colored dot within the triangle. Another button should clear the points.

(b) Extend your program to handle meshes. Generate a 2D mesh (perhaps the Delaunay triangulation for a random set of points), and then improve your program to pick a point (or 100 points) in the mesh uniformly at random. Do so by precomputing the triangle areas, summing them, and then assigning each triangle a probability given by its area divided by the total area. Put the triangles in some order, and compute probability sums s[0] = p[0], s[1] = p[0] + p[1], s[2] = p[0] + p[1] + p[2], etc. Given a uniform random variable u, you can now identify the largest index i with u ≤ s[i]. To generate a random mesh point, you can pick a uniform random number u, identify the last triangle i with u ≤ s[i], and then generate a random point in that triangle (see Exercise 32.6).

(c) Briefly discuss how to make the triangle-selection process faster than O(n), where n is the number of triangles in the mesh.

(d) Suppose that in ordering the triangles, we place the largest ones first. Then in a search of the list, we're likely to examine relatively few triangles to find the "right" one. Would you, in working with a typical graphics model, expect this to have a large impact on the sampling time? Why or why not?

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92166201

Have any Question?


Related Questions in Computer Engineering

Question 1 as part of the disaster recovery planning at a

Question: 1. As part of the disaster recovery planning at a medium-sized business you have been asked to develop a project plan to test the backups of production systems. 2. Develop an outline of the project plan for the ...

The measurements of the diametersnbspin inches of 12

The measurements of the diameters? (in inches) of 12 randomly chosen golf balls are listed. At alpha (α) = 0.05?, is there enough evidence to reject the claim that the standard deviation of the measurements of these diam ...

In linux what synchronization methods they use within the

In Linux what synchronization methods they use within the kernel, please dig into your findings for Linux.

String cyclic leftshift string s int k that creates and

String cyclic LeftShift (String s, int k) that creates and returns a string in which character of s has been moved left k steps, so that the characters that would "fall off' the left end are appended to the right. For ex ...

Question introduction to management information systemsread

Question: Introduction to Management Information Systems Read at least three (3) academically reviewed articles on Management Information Systems and complete the following activities: 1. Summarize all three (3) articles ...

Question suppose that you are searching an unsorted array

Question : Suppose that you are searching an unsorted array of objects that might contain duplicates. Devise an algorithm that returns a list of the indices of all objects in the array that match a given object. If the d ...

Going to concerts and reading books take time and money

Going to concerts and reading books take time and money. Suppose a book costs $10 and takes 3 hours to read and a concert costs $20 and takes 3 hours. For a person with $80 to spend and 18 hours for these activities: a. ...

Suppose you have a data file exampledat with two columns

Suppose you have a data file example.dat with two columns that contain bivariate data. Let's call these two variables X and Y. Write a MATLAB script (accompanied by explanations) that will use the data from the file to d ...

Question wireless transmission please respond to the

Question: Wireless Transmission" Please respond to the following: • Organizations need to be careful about their wireless transmissions and controlling the reception of the wireless signal. Discuss ways that organization ...

Question a show the results of inserting 10 12 1 14 6 5 8

Question : a) Show the results of inserting 10, 12, 1, 14, 6, 5, 8, 15, 3, 9, 7, 4, 11, 13, and 2, one at a into an initially empty binary heap. Show the tree at each stage. b) Show the result of performing three DeleteM ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As