Commit 094efa03 authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Distinguishing drawables in the scene + refactoring

parent bfa771b4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -102,6 +102,9 @@ public class Canvas extends javax.swing.JPanel {
        return sceneRenderer;
    }
    
    /**
     * Renders the scene.
     */
    public void renderScene() {
        glCanvas.display();
    }
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public class CanvasListener implements GLEventListener {
    @Override
    public void display(GLAutoDrawable glad) {
        //System.out.println("CanvasListener.display " + this.toString());
        canvas.getSceneRenderer().renderScene(canvas.getCamera(), canvas.getScene().getDrawables());
        canvas.getSceneRenderer().renderScene(canvas.getCamera(), canvas.getScene().getAllDrawables());
    }

    @Override
+3 −6
Original line number Diff line number Diff line
@@ -2,14 +2,11 @@ package cz.fidentis.analyst.gui.core;

import java.awt.BorderLayout;
import javax.swing.JPanel;
import org.netbeans.api.settings.ConvertAsProperties;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.windows.TopComponent;
import org.openide.util.NbBundle.Messages;

/**
 * Top component which displays something.
 * The space for control panels.
 * 
 * @author Radek Oslejsek
 */
/*
@ConvertAsProperties(
+16 −12
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@ package cz.fidentis.analyst.gui.scene;

import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2;
import cz.fidentis.analyst.mesh.core.MeshModel;
import java.awt.Color;
import javax.vecmath.Vector3d;

@@ -33,10 +32,15 @@ public abstract class Drawable {
     */
    private int renderMode = GL2.GL_FILL; // GL_FILL, GL_LINE, or GL_POINT
    
    /**
     * Renders the scene.
     * @param gl OpenGL context
     */
    public void render(GL2 gl) {
        initRendering(gl);
        
        gl.glPushMatrix(); {
        gl.glPushMatrix(); 
        
        // rotate
        gl.glRotated(getRotation().x, 1, 0, 0);
        gl.glRotated(getRotation().y, 0, 1, 0);
@@ -47,7 +51,7 @@ public abstract class Drawable {
        gl.glScaled(1 + getScale().x, 1 + getScale().y, 1 + getScale().z);
        
        renderObject(gl);
        }

        gl.glPopMatrix();
        
        finishRendering(gl);
+3 −2
Original line number Diff line number Diff line
@@ -7,8 +7,9 @@ import java.util.ArrayList;
import java.util.List;

/**
 * Drawable human face.
 * 
 * @author oslejsek
 * @author Radek Oslejsek
 */
public class DrawableFace extends DrawableMesh {
    
Loading