Skip to content

On screen rendering using matrixMode draws nothing in OPENGL in processing-1.5.1 #730

Description

@processing-bugs

Original author: nakednous@gmail.com (May 20, 2011 00:18:22)

If possible, please attach the smallest possible sketch that reproduces
your problem. First make a tiny example, then use Tools -> Archive Sketch
to create a zip file, and then attach it to this bug report.

What steps will reproduce the problem?

  1. Try to render a 2D shape on screen (such a line) on a 3D sketch using the new matrixMode(PROJECTION).
  2. The following code snippet tries to implement it:
    hint(DISABLE_DEPTH_TEST);
    matrixMode(PROJECTION);
    pushMatrix();
    ortho(-width/2, width/2, -height/2, height/2, -10, 10);
    matrixMode(MODELVIEW);
    pushMatrix();
    camera();
    stroke(255, 255, 0);
    //2d screen drawing goes here, e.g., draw a line:
    line(8, 8, 0, (width - 8), (height - 8), 0);
    matrixMode(PROJECTION);
    popMatrix();
    matrixMode(MODELVIEW);
    popMatrix();
    hint(ENABLE_DEPTH_TEST);

What is the expected output? What do you see instead?
The result is different depending on the renderer used:

  1. Using OPENGL no line is drawn (default renderer in the attached sketch).
  2. Using P3D the line is correctly drawn (don't forget to change the renderer string in the attached sketch).

What version of the product are you using? On what operating system?
Processing-1.5.1, Kubuntu-11.04 amd64, java version "1.6.0_24", OpenGL version string: 4.1.0 NVIDIA 270.41.06

Please provide any additional information below.
I'm trying to implement on screen drawing in proscene properly to solve the issue described here: http://code.google.com/p/proscene/issues/detail?id=1

Note: Please do not link to locations on other sites, such as your own
image site, video site, blog, etc. Include the relevant information here
with the report.

Original issue: http://code.google.com/p/processing/issues/detail?id=691

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions