Skip to content

The location of point light is not changing with mouse in p5.js version 1.0.0 #4391

Closed
@ahujadivyam

Description

@ahujadivyam

Most appropriate sub-area of p5.js?

  • Color
  • Core/Environment/Rendering
  • Data
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Details about the bug:

The location of point light is not changing with mouse in p5.js version 1.0.0
pointLight(255, 0, 0, mouseX - width/2, mouseY - height/2, 200);

  • p5.js version: 1.0.0
  • Web browser and version: Google Chrome Version 80.0.3987.132 (Official Build) (64-bit)
  • Operating System: Ubuntu 18.04 LTS
  • Steps to reproduce this:
let angle;

function setup() {
  createCanvas(800, 800,WEBGL);
  angle = 0;
}

function draw(){
  background(0,0,0,0);
  noStroke();
  pointLight(255, 0, 0, mouseX - width/2, mouseY - height/2, 200);
  specularMaterial(255,0,0);
  rotateX(angle);
  rotateY(angle);

  sphere(100);
  angle += 0.01;
}

This code works fine in p5.js version 0.10.2
https://editor.p5js.org/DivyamAhuja/sketches/ndOqBlh2

but the location of light doesn't change in version 1.0.0
https://editor.p5js.org/DivyamAhuja/sketches/IjnCX8L6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions