[SOLVED] Computer-Graphics - Assignment 2 –Lighting  Detail Instruction

30.00 $

Category:

Description

5/5 - (1 vote)

Goal

Implement 3 types of light sources:

  • Directional light
  • Position light (Point light)
  • Spot light

Interact and modify the light source in  runtime.

Finish the code in main.cpp, vertex  shader and fragment shader

Ap

Depend on your device

-10 for those upload “Normal Models”

For Mac

Depend on your device

-10 for those upload “x64” or “Normal Models”

For Windows           Make Sure exe canrun

Lighting Attribute Reference

  • Directional light:

Position: (1, 1,1)

Direction: always pointing at (0,0,0)

  • Position(point) light

Position: (0, 2,1)

  • Spot light

Position: (0, 0, 2)

Direction: (0, 0, -1)

Exponent: 50

Cutoff: 30 degree

Lighting Attribute Reference

  • Diffuse intensity: (1, 1, 1)
  • Ambient intensity: (0.15, 0.15, 0.15) Shininess: 64 Attenuation:

Point light:

  • Constant: 0.01
  • Linear: 0.8 Quadratic: 0.1 Spot light:
  • Constant: 0.05
  • Linear: 0.3
  • Quadratic: 0.6

 

  • Please follow the spec bellow, or you would notget the score of item.
  • You must make sure your key mapping is exactly same to ours.
  • Z/X: switch the model
  • T: switch to translation mode
  • S: switch to scale mode
  • R: switch to rotation mode
  • L: switch between directional/point/spot light
  • K: switch to light editing mode
  • J: switch to shininess editing mode

If you switch mode by T, S, R

Apply change on Z axis when scroll the wheel

Apply change on X axis when mouse drag horizontally

Apply change on Y axis when mouse drag vertically

Only rotation should apply X axis when mouse drag vertically, and Y axis when mouse drag horizontally

If you switch mode by K

Apply change on X axis of light’s position when mouse drag horizontally

Apply change on Y axis of light’s position when mouse drag vertically

Apply change on diffuse intensity for directional or point light, cutoff angle for spot light when scroll the wheel

If you switch mode by J

Apply change on shininess when scroll the  wheel

The shininess is applied to all models.