octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #8943] object class "light" for lighting e


From: Markus Mützel
Subject: [Octave-patch-tracker] [patch #8943] object class "light" for lighting effects on patches and surfaces
Date: Mon, 14 Mar 2016 15:24:18 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0

URL:
  <http://savannah.gnu.org/patch/?8943>

                 Summary: object class "light" for lighting effects on patches
and surfaces
                 Project: GNU Octave
            Submitted by: mmuetzel
            Submitted on: Mo 14 Mär 2016 15:24:17 GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Hi,

attached please find a first try of getting lighting effects to work on
patches and surfaces.

"light.patch" includes the changes to Octave core functions. "light.m" is the
actual function called from Octave to add a light source to the current axes.

As I am neither an expert in C++ nor OpenGL programming, I am happy that it
seems to work quite well at least for me. I would appreciate any help, tips,
info and opinions.

The current implementation suffers the following limitations:
- Only one light source is supported. I might work on this on a follow-up
patch if I figure out a way to handle this.
- The "VertexNormals" of "patch" objects must be set manually. I think I know
how to calculate the normals automatically but I am still working out how to
patch the "patch" objects correctly.
- Only light sources at infinity are supported.
- The setting of "BackFaceLighting" of the "patch" and "surface" objects is
ignored. I might work on implementing "backlit" later as it seems to be a side
effect when calculating patch normals.
- It only works with "qt" and "fltk". When adding a "light" object with
"gnuplot", it fails with the following error and nothing is drawn:

error: __gnuplot_draw_axes__: unknown object class, light
error: called from
    __gnuplot_draw_axes__ at line 1363 column 9
    __gnuplot_draw_figure__ at line 172 column 17
    __gnuplot_drawnow__ at line 86 column 5


I am leaving this to a gnuplot expert, since I do not know how to handle this
correctly. Just inserting an empty case for "light" did produce a lot of
different errors...

If this patch (or an improved one) was accepted, it would be quite easy to add
other related functions as e.g. lighting, shading, camlight or material.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mo 14 Mär 2016 15:24:17 GMT  Name: light.patch  Size: 8kB   By:
mmuetzel

<http://savannah.gnu.org/patch/download.php?file_id=36632>
-------------------------------------------------------
Date: Mo 14 Mär 2016 15:24:17 GMT  Name: light.m  Size: 5kB   By: mmuetzel

<http://savannah.gnu.org/patch/download.php?file_id=36633>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8943>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]