Changeset 2298


Ignore:
Timestamp:
Jan 30, 2013, 1:00:13 PM (10 years ago)
Author:
sam
Message:

meshviewer: add two lights.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/.gitignore

    r2214 r2298  
    7171test/benchsuite
    7272test/btphystest
     73test/meshviewer
    7374test/testsuite
    7475test/sandbox/sample
  • trunk/test/Makefile.am

    r2294 r2298  
    1111EXTRA_DIST = data/gradient.png
    1212
    13 noinst_PROGRAMS = benchsuite $(testsuite) btphystest MeshViewer
     13noinst_PROGRAMS = benchsuite $(testsuite) btphystest meshviewer
    1414
    1515TESTS = $(testsuite)
     
    5050btphystest_DEPENDENCIES = $(top_builddir)/src/liblol.a
    5151
    52 MeshViewer_SOURCES = MeshViewer.cpp
    53 MeshViewer_CPPFLAGS = @LOL_CFLAGS@
    54 MeshViewer_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@
    55 MeshViewer_DEPENDENCIES = $(top_builddir)/src/liblol.a
     52meshviewer_SOURCES = MeshViewer.cpp
     53meshviewer_CPPFLAGS = @LOL_CFLAGS@
     54meshviewer_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@
     55meshviewer_DEPENDENCIES = $(top_builddir)/src/liblol.a
    5656
  • trunk/test/MeshViewer.cpp

    r2296 r2298  
    3131        {
    3232            m_meshes.Push(EasyMesh());
    33             m_meshes.Last().Compile("[sc#0f0 ab 2 2 2 t .8 .8 .8 rx 20 ry 20 [sc#00f ab 2 2 2 tx 0 csgu]]");
     33            m_meshes.Last().Compile("[sc#2f2 ab 2 2 2 t .8 .8 .8 rx 20 ry 20 [sc#22f ab 2 2 2 tx 0 csgu]]");
    3434        }
    3535
     
    4444        m_camera->ForceSceneUpdate();
    4545        Ticker::Ref(m_camera);
     46
     47        m_lights << new Light();
     48        m_lights.Last()->SetPosition(vec4(4.f, -1.f, -4.f, 0.f));
     49        m_lights.Last()->SetColor(vec4(.0f, .2f, .5f, 1.f));
     50        Ticker::Ref(m_lights.Last());
     51
     52        m_lights << new Light();
     53        m_lights.Last()->SetPosition(vec4(8.f, 2.f, 6.f, 1.f));
     54        m_lights.Last()->SetColor(vec4(.5f, .3f, .0f, 1.f));
     55        Ticker::Ref(m_lights.Last());
     56
    4657        min_pos = vec3(FLT_MAX);
    4758        max_pos = vec3(-FLT_MAX);
     
    5364    {
    5465        Ticker::Unref(m_camera);
     66        for (int i = 0; i < m_lights.Count(); ++i)
     67            Ticker::Unref(m_lights[i]);
    5568    }
    5669
     
    7487        vec4 c(0, 0, -2, 1.0f);
    7588        vec4 d(-1, -1, 1, 1.0f);
    76        
     89
    7790        //vec2 toto;
    7891        //near plane : vec4(toto, 1.f, 1.f);
     
    153166
    154167    Array<EasyMesh> m_meshes;
     168    Array<Light *> m_lights;
    155169    Camera *m_camera;
    156170
Note: See TracChangeset for help on using the changeset viewer.