From f1c718cce66e5651a0dae91375db6ebfaded1a92 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Sat, 27 Apr 2019 21:33:41 -0400 Subject: [PATCH] Test unfold UV --- cMesh.java | 104 ++-------------------------------------------------- 1 files changed, 4 insertions(+), 100 deletions(-) diff --git a/cMesh.java b/cMesh.java index c2eb4ad..d49f23c 100644 --- a/cMesh.java +++ b/cMesh.java @@ -1,6 +1,6 @@ import java.util.Hashtable; -import javax.media.opengl.GL; +//import javax.media.opengl.GL; public class cMesh extends cSpring { @@ -78,7 +78,7 @@ live = true; } - + Object3D deepCopy() { /* @@ -484,7 +484,7 @@ } - void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected) // ?? + void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected) // ?? { // ?????? if (size() > 0) // { @@ -545,103 +545,7 @@ if(/*showsprings &&*/ Phys != null) { - GL gl = display.GetGL(); // getGL(); - - gl.glDisable(gl.GL_LIGHTING); - - gl.glLineWidth(1); - gl.glColor3f(1,1,1); - gl.glBegin(gl.GL_LINES); - double scale = 0; - int count = 0; - for (int s=0; s<Phys.allSprings.size(); s++) - { - Spring spring = Phys.allSprings.get(s); - if(s == 0) - { - //System.out.println(" spring : " + spring.a.position + "; " + spring.b.position); - } - if (showsprings) - { - temp.set(spring.a.position); - temp.add(spring.b.position); - temp.mul(0.5); - temp2.set(spring.a.position); - temp2.sub(spring.b.position); - temp2.mul(spring.restLength/2); - temp.sub(temp2); - gl.glVertex3f((float)temp.x, (float)temp.y, (float)temp.z); - temp.add(temp2); - temp.add(temp2); - gl.glVertex3f((float)temp.x, (float)temp.y, (float)temp.z); - } - - if (spring.isHandle) - continue; - - //if (scale < spring.restLength) - scale += spring.restLength; - count++; - } - gl.glEnd(); - - if (count == 0) - scale = 0.01; - else - scale /= count * 3; - - //scale = 0.25; - - if (ShowInfo()) - { - gl.glLineWidth(4); - for (int s=0; s<Phys.allNodes.size(); s++) - { - DynamicNode node = Phys.allNodes.get(s); - if (node.mass == 0) - continue; - - int i = node.springs==null?-1:node.springs.size(); - gl.glColor3f((i>>2)&1,(i>>1)&1,i&1); - //temp.set(node.springForce.x, node.springForce.y, node.springForce.z); - //temp.normalize(); - //gl.glColor3d((temp.x+1)/2, (temp.y+1)/2, (temp.z+1)/2); - gl.glBegin(gl.GL_LINES); - gl.glVertex3d(node.position.x, node.position.y, node.position.z); - //gl.glVertex3d(node.position.x + node.normal.x*scale, node.position.y + node.normal.y*scale, node.position.z + node.normal.z*scale); - gl.glVertex3d(node.position.x + bRep.GetVertex(s).norm.x*scale, - node.position.y + bRep.GetVertex(s).norm.y*scale, - node.position.z + bRep.GetVertex(s).norm.z*scale); - gl.glEnd(); - } - - gl.glLineWidth(8); - for (int s=0; s<Phys.allNodes.size(); s++) - { - DynamicNode node = Phys.allNodes.get(s); - - if (node.springs != null) - { - for (int i=0; i<node.springs.size(); i+=1) - { - DynamicNode f = node.springs.get(i).GetOther(node); - - int c = i+1; - // c = node.springs.get(i).nbcopies; - - gl.glColor3f((c>>2)&1,(c>>1)&1,c&1); - gl.glBegin(gl.GL_LINES); - gl.glVertex3d(node.position.x, node.position.y, node.position.z); - gl.glVertex3d(f.position.x/3+node.position.x*2/3, f.position.y/3+node.position.y*2/3, f.position.z/3+node.position.z*2/3); - gl.glEnd(); - } - } - } - - gl.glLineWidth(1); - } - - gl.glEnable(gl.GL_LIGHTING); + display.DrawDynamicMesh(this); } if (live && Globals.isLIVE() && display.DrawMode() == CameraPane.DEFAULT) -- Gitblit v1.6.2