Tuesday, November 26, 2019

cst325 w5


This week, we worked on shaders, texturing, and transparency. We used texture mapping and filtering, applied images as textures to objects, understood methods and limitations of alpha blending, and applied alpha blending in WebGL.

Texturing is a process that takes a surface and modifies it at each location using an image, function or other data source. It makes 3D scenes look real.

In rendering, many buffers are used. A buffer is a part of memory that stores data per pixel like color and depth buffers.

The depth test using the Z-buffer compares the current fragment depth against the corresponding value in the depth buffer, if its less; it will be kept. Other tests are alpha, stencil, and scissor. The alpha test is used to remove colors where the opacity is not above a value. The stencil test is used to compare a fragment to another value in the buffer. The scissor test determines if a pixel is in a user defined rectangle, only keeping if it is inside.

Alpha blending uses an equation to determine if the new color overwrites the current buffer color and how much it contributes.

Wednesday, November 20, 2019

cst325 w4

This week, we learned about raytracing and it's similarities and differences from rasterization. We also learned about the CPU and GPUs role in rasterization. After, we learned about applying matrix transforms to geometry. Then we learned about how to manipulate render state and issue commands for 3D scenes in WebGL.

Polygon meshes are a collection of vertices, edges and faces that make an object. Triangles are combined with shared edges to make the object. The vertices are position, color, and texture coordinates. These meshes are used in the Rasterization pipeline because they are all triangles, are easy to calculate, and work well with hardware like CPUs and GPUs (heterogeneous computing)

The graphics pipeline is the model that describes the steps the system takes to make a 3D scene into a 2D one: Application, Geometry, Rasterization, and then to Screen. In Raytracing, the nesting order goes from pixel to object, and in Rasterization it is the opposite.

In the CPU, the application creates/loads geometry, then gives commands to the API what when and how to draw, it loads the triangle mesh data then issues a command to render. In the GPU, geometric transformations are applied to vertices and make primitives from them. Vertices are transformed from their locally defined space to the screen space, then they are assembled into triangles which receive values interpolated from the vertices. Then in Rasterization, the triangles are converted to pixels and then shaded; creating the final image. Each fragment finds the closest to the camera through the Z-value.

Tuesday, November 12, 2019

cst 325 w3


This week, we learned how vectors and matrices are connected. We also learned how matrices are used to manipulate space and how to solve problems with matrix operations. We also created and combined matrix transformations.

Unfortunately, I did not have very much time to work on the lab because I went out of town and only had my laptop which is horrible. In the future, I think I’ll only go out of town on holidays and everyone else is going to have to deal with the fact that I have school, which is a priority and doing construction work all weekend on a condo I have no equity in is not really my priority.

A matrix describes the relationship between 2 coordinate spaces. It is a rectangular grid of numbers arranged into rows and columns defined in rows first then columns. A matrix may have 1 row or 1 column and are called row vectors and column vectors. A transposed matrix is where the column and rows are flipped. A diagonal matrix is equal to its transpose matrix. A scalar is a regular number and you just multiply the scalar by every element in the matrix. When you multiply two matrices, the columns in A must be the same amount of rows in B, if not it is not defined.

Rotation is about a point in 2D or about the origin based on the angle value. Scale is used to make matrices larger or smaller b a factor of k. There is uniform and nonuniform scale. In uniform scale, it dilates about the origin and preserves angles and proportions, the lengths change by k units, areas change by k squared, and volumes by k cubed. Nonuniform scale has different scale factors. The absolute value of k is shorter when less than 0. When k is 0, it has orthographic projection. Is reflected when k is negative and scales (?) when k is positive. It scales along the x axis when applied about the perpendicular axis. The basis vectors are independently affected by scale vectors so one can make a big y and small x object. In reflection, it is flipped about a line 2D or plane 3D. Shear is a transformation that skews the coordinate space, stretching nonuniformly. The angles are not preserved, but the areas and volumes are preserved.

Tuesday, November 5, 2019

CST 325 W2

This week, we learned about raytracing. We wrote the code for the basic raytracer and used diffuse shading using the Lambert term. We then created shadows from light occlusion and used vector operations for image generation.

Raytracing uses a camera, image, object, view ray, and shadow ray. We trace the ray from the camera through each image block resulting in the following. The ray will hit the sphere, the plane, both, or none. When the ray hits the sphere and plane, only the closest is used. If an object is between the ray and the light, light is occluded and the object casts a shadow. Lambert's Law states that the intensity of the reflected light is related to it's orientation. The greater the angle of the cosine between the light ray and surface, the less intense light. If the cosine of the angle is 1, the surface is facing the light and is fully lit, if its 0, it points away and is not lit. If it's between 0 and 1, it depends on the intensity but is partially lit. When the ray hits the sphere, it will cast a shadow on the plane. If d1 is the distance from the eye to the object and d2 is the distance from the eye to the light; if d1<d2, there will be a ray intersection and a shadow. If d1>d2, there will be a ray intersection but no shadow. In other words, if it can see the light, the shadow is based on the angle, if it doesn't, it will be set to black.

Tuesday, October 29, 2019

CST 325

This week, we learned about how vectors and scalars are connected, how vectors are used to think about space, how different equations can represent surfaces, and how to create rays with implicit surfaces.

This week, we learned about vector operations and their history. In a vector is a displacement/oriented magnitude where an origin is not needed with a magnitude: the length of a segment. The Pythagorean theorem is used to calculate the magnitude. A unit vector is a vector with a hat and magnitude 1. In vector normalization, the unit vector v with a hat, is found by dividing the vector by the magnitude.

In vector addition, the x1 and y2 are added across and is commutative. In vector subtraction, they are subtracted across in the same way but they are anti-commutative. Vector multiplication by a scalar is multiplied across. In vector multiplication, there is no multiplication symbol because that is the cross product. In scalar division, you can divide by a scalar. In the vector dot product, the dot product of a and b is the sum of a*b. The vector cross product has a specific pattern that is hard to describe in words so it's better to see a picture example.

Saturday, October 19, 2019

CST 311 W 8


This week, we learned about securing TCP, network layer security IPSEC and VPN, securing wireless LANs, and operational security firewalls and intrusion detection.

TCP connections can be secured with Secure Sockets Layer (SSL). SSL is widely used by e-commerce and web-server authenticators to ensure confidentiality, integrity and authentication of the site. It is supported by almost all web servers and browsers and is identified as HTTP but with an S at the end. It is available to all TCP applications and sits between the Application and TCP. It involves a handshake, key derivation, data transfer, and connection closure. A and B use their certificates to authenticate each other and exchange the shared secret, then use the secret to make keys to exchange messages with. The data is transferred in parts and then the connection is closed.

Virtual Private Networks (VPN) are used to provide more security for private networks when using public WIFI or less secured home WIFI. The data is encrypted before it enters the public internet.

WIFI Each packet is separately encrypted and can be decrypted even if previous packets are lost. This can be implemented in hardware and software.  WEP can be broken however, so WEP2 is used.

Firewalls are used to isolate an organization from the internet by filtering packets. Firewalls are used to prevent DOS attacks, modification/access of data, and only allows authenticated users to use their network. Stateless packet filtering involves an internet network with a router firewall. The router filters packets by source/destination IP, TCP/UDP source and destination port numbers, ICMP message types, and TCP SYN and ACK bits. Stateless packet filtering may block IP protocol 17 and the entirety of port 23 resulting in UDP and telenet connections being blocked. If an organization doesn’t want TCP connections from the outside, they would drop all TCP SYN packets except to their web server.  Stateful packet filtering tracks the status of every TCO connection and drop packets that don’t make sense and won’t admit packets if they created inactive connections at the firewall.

Tuesday, October 15, 2019

CST 311 W 7


This week, we learned about the link layer, error detection and correction, MAC protocols, and LANs and switches. In chapter 8, we learned about network security, principles of cryptography, message integrity and digital signatures, and end point authentication.
The link layer transfers datagrams from one node to an adjacent node over a link. Error detection and correction is not 100% reliable but is done through single- and two-dimensional bit parity. In 2d bit parity, single bit errors are found and corrected using the checksum.
MAC protocols are distributed algorithms that find how nodes share a channel. The communication uses the channel. MAC protocols have 3 classes: channel partitioning, random access, and taking turns. Channel partitioning divides the channel into smaller pieces like time slots, frequency or code then allocates each piece to a node for use. The random-access protocol doesn’t divide the channel and can allow collusions which are bad. It can recover from collisions, however. In taking turns, the nodes take turns vu the nodes with more to send take longer.
In the ARP: address resolution protocol, it determines the interface’s MAC address from its IP address. It contains an ARP table which has each IP node on a LAN where the IP/MAC address for some LAN nodes are known. It also has the TTL: Time to Live time where the address mapping expires after about 20 minutes. If the nodes are on the same LAN, and the destinations MAC address is not on the ARP table, the source will broadcast the ARP query with the destinations IP address. The destinations MAC address will be FF-FF-FF-FF-FF-FF. The destination will get this ARP packet and reply to the source with their MAC address. The source saves the UP to MAC address in the ARP table until the info times out.  
Ethernet is the most popular Lan wired technology and widespread with rates of 10Mbps-10Gbps. In the past, the bus architecture was used but it often has collisions. Now, the star architecture is used where a switch is in the center and the nodes don’t have collisions. The Ethernet switch is a link-layer device that stores and forwards ethernet frames. It looks at the MAC address and forwards the frames to other links where the frame needs to be forwarded.  Hosts have a dedicated connection to a switch where packets are buffered.

cst 499 week 8

This week, we finished writing the paper in order to do the best job possible even if it was a little bit late. Now that everything is done,...