Skip to content

Can't draw a Line in WEBGL Renderer if previously a texture was defined #5440

Closed
@bsondermann

Description

@bsondermann

Hi,
when I want to draw a line with the WEBGL Renderer, it works no problem, but when I draw a 3D object with texture before that, the line won't be displayed.

  • WebGL
  • p5.js version: 1.4.0
  • Web browser and version: Google Chrome 94.0.4606.61
  • Operating System: Windows
  • Steps to reproduce this:
let g;
let gtex;
function preload(){
  g = loadModel('js/gimbal.obj',false);
  gtex = loadImage('js/gimbaltex.png');
}
function setup(){
  createCanvas(720, 240,WEBGL);
  ortho();
}
function draw(){
  smooth();
  clear();
  
  translate(0,0,-100);
  noStroke();
  directionalLight(255, 255, 255,0,0, 1);
  directionalLight(255, 255, 255,0,0, -1);
  rotateX(PI);
  push();
  translate(-240,0,0); 
  scale(4+(2/3));
  texture(gtex); // when I disable this texture (comment it out), the line gets drawn no problem, but otherwise not.
  model(g);
  stroke(255,0,0);
  noFill();
  line(0,0,0,100,100,100);
}

files.zip
Here are the 3D Models!

Thanks
Bastian

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    DONE! 🎉

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions