Resize sketch error

Hmmm it is not important. Magic numbers refers to numbers that appear in your code that do the job “magically”. However, for clarity, those numbers, if constant, should be defined as constants. In your case, you do not need to do so as you have the following fields you can use instead: width and height. I encourage ppl to assign proper labels to their numbers in a sketch. In your case, it is very important. Why? Because you are working with three objects that have dimensions:

  • Your sketch which you define via size()
  • Your PImage object. Dimensions defined via createImage()
  • Your kinect unit, which provides dimensions as dictated by the spec sheet of the device.

It is important because you can create a sketch or a PImage with different dimensions that your kinect unit. Nothing wrong with this, but assigning proper names to your variables will make your code easy to maintain and you will be able to spot errors yourself.

Kf