diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/scene/DrawableMesh.java b/GUI/src/main/java/cz/fidentis/analyst/gui/scene/DrawableMesh.java index 82ee9db24d6e7ef5225cf62368aee9d17f1b3c04..dc7177befa8a2195c9760be935763bb9a0be61f7 100644 --- a/GUI/src/main/java/cz/fidentis/analyst/gui/scene/DrawableMesh.java +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/scene/DrawableMesh.java @@ -2,6 +2,7 @@ package cz.fidentis.analyst.gui.scene; import cz.fidentis.analyst.mesh.core.MeshFacet; import cz.fidentis.analyst.mesh.core.MeshModel; +import java.awt.Color; import java.util.List; /** @@ -18,6 +19,11 @@ public class DrawableMesh { private boolean display = true; // TO DO - R. Pajersky: add transformation attributes and methods + private Color color; + + public Color getColor() { + return color; + } /** * Constructor. diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/scene/SceneRenderer.java b/GUI/src/main/java/cz/fidentis/analyst/gui/scene/SceneRenderer.java index cda999208c6311f269071aea9dc2b7304cb13c64..364fa6d8e9f90f9e4a061d2888c8f658f1bc0e1e 100644 --- a/GUI/src/main/java/cz/fidentis/analyst/gui/scene/SceneRenderer.java +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/scene/SceneRenderer.java @@ -59,6 +59,11 @@ public class SceneRenderer { gl.glEnable(GL2.GL_NORMALIZE); gl.glDisable(GL2.GL_CULL_FACE); + + //color enabled + gl.glEnable(GL2.GL_COLOR_MATERIAL); + gl.glEnable(GL2.GL_BLEND); + gl.glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA); } /** @@ -128,6 +133,9 @@ public class SceneRenderer { } for (DrawableMesh obj: drawables) { + // render color + if (obj.getColor() != null) + gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_DIFFUSE, obj.getColor().getComponents(null), 0); for (MeshFacet facet: obj.getFacets()) { // TO DO - R. Pajersky: add transformation (glPushMatrix, glRotate, ...) renderFacet(facet); @@ -181,7 +189,8 @@ public class SceneRenderer { gl.glNormal3d(norm.x, norm.y, norm.z); } // render the vertices - Point3d vert = facet.getVertices().get(facet.getCornerTable().getRow(v).getVertexIndex()).getPosition(); + gl.glColor4f( 0.0f,1.0f,0.0f, 0.5f ); + Point3d vert = facet.getVertices().get(facet.getCornerTable().getRow(v).getVertexIndex()).getPosition(); gl.glVertex3d(vert.x, vert.y, vert.z); } diff --git a/GUI/src/main/java/cz/fidentis/analyst/newgui/PostRegistrationCP.form b/GUI/src/main/java/cz/fidentis/analyst/newgui/PostRegistrationCP.form index d493394b45fd979f9535f76591d38139aef39ae5..9728e92906018911882b7bf460d143228ad64202 100644 --- a/GUI/src/main/java/cz/fidentis/analyst/newgui/PostRegistrationCP.form +++ b/GUI/src/main/java/cz/fidentis/analyst/newgui/PostRegistrationCP.form @@ -300,7 +300,7 @@ <Component id="jSeparator7" min="-2" pref="10" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="featurePointsButton" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="306" max="-2" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> diff --git a/GUI/src/main/java/cz/fidentis/analyst/newgui/PostRegistrationCP.java b/GUI/src/main/java/cz/fidentis/analyst/newgui/PostRegistrationCP.java index c1d0920e487d6a64838c296efd3af5ceb053f63d..8be0b8e7d223f5862e9bce07a09c64c32388623d 100644 --- a/GUI/src/main/java/cz/fidentis/analyst/newgui/PostRegistrationCP.java +++ b/GUI/src/main/java/cz/fidentis/analyst/newgui/PostRegistrationCP.java @@ -600,7 +600,7 @@ public class PostRegistrationCP extends javax.swing.JPanel { .addComponent(jSeparator7, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(featurePointsButton) - .addGap(306, 306, 306)) + .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents