import numpy import matplotlib.pyplot as plt class Sphere: def __init__(self): z=1 def add(self, points, radius, color): return dict(type='sphere', points=numpy.array(points), radius=numpy.array(radius), color=numpy.array(color), reflection=.5) def intersect(self, e, s, pos, Rad): # Check for intersects A = numpy.dot(s, s) B = 2 * numpy.dot(s, (e - pos)) C = numpy.dot((e - pos), (e - pos)) - Rad * Rad delta = B * B - 4 * A * C if delta > 0: t1 = (-B - numpy.sqrt(delta)) / (2.0 * A) t2 = (-B + numpy.sqrt(delta)) / (2.0 * A) t1, t2 = min(t1, t2), max(t1, t2) if t2 >= 0: return …show more content…
obj = scene[idx] p = rayO + rayD * t n = getNormal(obj, p) k = getColor(obj, p) normal_l = (l-p) / numpy.linalg.norm(l - p) v = (e-p) / numpy.linalg.norm(e - p) # shadowed or not. hit = [] for j in range(len(scene)): obj_sh = scene[j] if j!= idx: result = intersect(p + n * .0001, normal_l, obj_sh) hit.append(result) #print(hit) if hit and min(hit) < numpy.inf: return # La. color1= La # Calculating Ld. color1 += obj.get('diffuse_c', Ld) * max(numpy.dot(n, normal_l), 0) * k # Calculating Ls. h = (normal_l + v) / numpy.linalg.norm(normal_l + v) color1 += obj.get('specular_c', Ls) * max(numpy.dot(n, h), 0) ** k * light_color return obj, p, n, color1 s = Sphere() p = Plane() # List of objects on scene. scene = [s.add([.75, .1, 1.], .6, [0., 0., 1.]), s.add([-.75, .1, 2.25], .7, [.5, .223, .5]), p.add([0., -.5, 0.], [0., 1., 0.], [.5, .223, .5]), ] l = numpy.array([5., 5., -10.]) light_color = numpy.zeros(3) La = .05 Ld = 1. Ls = 1. k = 50 nrows = 400 ncols = 300 Maxdepth = 2 # Max number of light reflections. col = numpy.zeros(3) e = numpy.array([0., 0.35,
| (TCO 2) In the RGB system, the intensity of colors is assigned a number from ____ to 255.
6) Now click on ‘Circular’ on the bottom. Describe the motion of the ball and the behavior of the two vectors. Is there a force on the ball? How can you tell? Be detailed in your explanations.
Knowing this information, you need to first tell me, and then show this in your graph:
In these etchings, there several planets depicted with many moons and other planetary bodies surround them. These two etchings are similar in many ways, but there are some unique aspects in each of them in terms of color. The etching entitled Cosmos features one main planet in the center with several moons that are larger when compared with those in his other etching Le Cap Horn. Cosmos shows the space ship flying near the upper portion of the large gray-colored planet. The area surrounding the planet is colored with white and a very light pink color. The outside edges of this piece are colored with a light blue color that gets increasingly darker as it moves to the very outside portion of the piece. Le Cap Horn, on the other hand, shows a smaller planet in the center of the piece with the space ship flying away and to the left of the planet. This etching just like the other shows several moons surrounding this planet. Color does not vary as much in Le Cap Horn when compared to Cosmos. In this piece, the vast majority is black with some light gray and white areas surrounding the central planet. This planet along with
The very popular anime, Dragon Ball, and the not so popular cartoon, Ren & Stimpy, are alike and different in many ways. Some of which are very clear and some of which are very unclear. Ren & Stimpy was an animated cartoon series produced by Canadian animator, John Kricfalusi for Nickelodeon. The show premiered on August 11, 1991, the same day as Rugrats and Doug, being one of the first nicktoons. The series was rated TV-Y7 on Nickelodeon, Nicktoons, and MTV2 and TV-PG on Spike TV repeats.
A spin depicts circular motion. I wanted to investigate how the skater’s free leg affects the amplitude, and period of a cosine function. To analyze this I chose to video a figure skater doing a spin from a birds eye view, this way the points could be tracked all the way around the circle. If the video was taken facing the skater, many of the points on the cosine curve would be ‘hidden’ by the skater’s body. In figure 8, 9, and 10 show the different spins I chose to analyze.
A pika is a small mammal in the ochotonidae family. Pikas have a round body, very short limbs, rounded ears and are usually short haired. (and really cute) They look more like a mouse but are way more closely related to a rabbit. There are about thirty different types of pikas that are still alive. Almost all pika species are extinct, and all of the species that are alive, are highly endangered. According to Natureworks, there are two different pika species in north America, and twenty-eight in Asia. The most common species is the American pika. They live in the northwestern united states and a tiny bit of Canada. The second most common species of pika is the Ili pika, (or Chinese pika) which kind of has the face of a teddy bear. They live
The purpose of this lab was "to measure the position of a ball as a function of time and to analyze the motion using graphical analysis."
Space battleship Yamato is a 2010 Japanese science fiction film directed by Takashi Yamazaki. It’s set in 2199, when 5 years ago, an alien race called the Gamillas, attack the Earth and left the surface uninhabitable due to radiation. The human race is forced to live underground. However, everything changes when Susumu Kodai discovers a capsule sent from the distant planet of Iskandar that says that there is technology that can remove the radiation from the earth. However, while discovering this Susumu breathes in a high amount of radiation and almost dies. Luckily, he is saved by Captain Okita. Okita sees the capsule and has hope that it could save earth. He requests volunteers and Susumu decides to enrol. They rebuild the “Yamoto” and Susumu reunites with his old squad, including Yuki, his love interest. They make it to Iskandar where it is revealed that the planet of Iskandar is actually the planet of Gamillas, and is just like Earth in the way that it is uninhabitable. Once they reach the place they were meant to be, an alien possesses Yuki and tells them the story of how their planet was about to disintegrate, and how
And D is the principal axis, as the min. value and max. value has already changed, so the new value for D would be 12.15+0.82=6.475
The reason for this lesson is to allow for an introductory lesson to three-dimensional shapes that the students will see throughout their educational career, as well as create a more equitable environment in the classroom by serving as a form of an icebreaker for the students and their peers.
In this case, the values (1,1), (2,1), and (3,1) all have the same x-coordinate which can cause problems in the algorithm if not handled correctly. A general way to order the convex hull points is simply by x-coordinate, so if two points shared that x-coordinate, the ordering system is defined poorly. This was fixed by ordering the points in a lexicographical way, such that if two points have the same x-coordinate, they will be further sorted by the y coordinate. I’ve done this type of sorting in my code.
IMPLEMENTATION OF RAY TRACING Submitted in partial fulfillment of the requirements of CSCI 580 Project By ZIWEN CAO, MENGTIAN ZHOU, HSIN-HO HUANG, GANESH KUMAR SWAMINATHAN UNIVERSITY OF SOUTHERN CALIFORNIA 05/05/2015 CONTENTS Contents 2 List of Illustrations 3 1. ABSTACT 8 2. INTRODUCTION AND BACKGROUND MOTIVATION
The ratio between the gradients for run 1 and run 2 is 1:2 as 0.4/0.263 is approximately half, whereas the gradient for runs 2 and 3 is 3:2 as 0.563/0.4 is approximately 1.5.
The diagram shows two balls P and Q at the same height above the ground. Ball P is projected