[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz gfx/jni/GzzGL-jni.cxx gzz/gfx/gl/GL.java gz...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz gfx/jni/GzzGL-jni.cxx gzz/gfx/gl/GL.java gz... |
Date: |
Sat, 19 Oct 2002 10:26:37 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/10/19 10:26:37
Modified files:
gfx/jni : GzzGL-jni.cxx
gzz/gfx/gl : GL.java GLVobCoorder.java
Log message:
Transform for interpolated points
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/jni/GzzGL-jni.cxx.diff?tr1=1.51&tr2=1.52&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GL.java.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GLVobCoorder.java.diff?tr1=1.43&tr2=1.44&r1=text&r2=text
Patches:
Index: gzz/gfx/jni/GzzGL-jni.cxx
diff -c gzz/gfx/jni/GzzGL-jni.cxx:1.51 gzz/gfx/jni/GzzGL-jni.cxx:1.52
*** gzz/gfx/jni/GzzGL-jni.cxx:1.51 Mon Oct 14 14:15:19 2002
--- gzz/gfx/jni/GzzGL-jni.cxx Sat Oct 19 10:26:36 2002
***************
*** 1126,1131 ****
--- 1126,1183 ----
return 1;
}
+ JNIEXPORT jboolean JNICALL Java_gzz_gfx_gl_GL_transform2
+ (JNIEnv *env, jclass, jint ninds, jintArray j_inds, jfloatArray j_pts,
+ jintArray j_interpinds, jintArray j_inds2, jfloatArray j_pts2,
+ jfloat fract, jboolean show1,
+ jint coordsys, jboolean inverse, jfloatArray j_points, jfloatArray
j_into) {
+
+ jint *inds = env->GetIntArrayElements(j_inds, 0);
+ jfloat *pts = env->GetFloatArrayElements(j_pts, 0);
+
+ jint *interpinds = env->GetIntArrayElements(j_interpinds, 0);
+
+ jint *inds2 = env->GetIntArrayElements(j_inds2, 0);
+ jfloat *pts2 = env->GetFloatArrayElements(j_pts2, 0);
+
+ Coords::CoordSet coordset;
+ coordset.clean();
+ coordset.setPoints((int)ninds, (int*)inds,
+ (float*)pts, (int*)interpinds,
+ (int*)inds2, (float*)pts2,
+ (float)fract, (bool)show1);
+
+ int arrayLength = env->GetArrayLength(j_points);
+ jfloat *points = env->GetFloatArrayElements(j_points, 0);
+ jfloat *into = env->GetFloatArrayElements(j_into, 0);
+
+ Coords::CoordSys *cs = coordset.get(coordsys);
+ if(cs != 0) {
+ if(inverse) cs = cs->getInverse();
+ for(int i=0; i<arrayLength; i+=3) {
+ ZPt pt(points[i], points[i+1], points[i+2]);
+ ZPt pt2 = cs->transform(pt);
+ into[i] = pt2.x;
+ into[i+1] = pt2.y;
+ into[i+2] = pt2.z;
+ }
+ }
+
+ env->ReleaseFloatArrayElements(j_points, points, JNI_ABORT);
+ env->ReleaseFloatArrayElements(j_into, into, 0); // These were changed,
commit.
+
+ env->ReleaseIntArrayElements(j_inds, inds, JNI_ABORT);
+ env->ReleaseFloatArrayElements(j_pts, pts, JNI_ABORT);
+
+ env->ReleaseIntArrayElements(j_interpinds, interpinds, JNI_ABORT);
+
+ env->ReleaseIntArrayElements(j_inds2, inds2, JNI_ABORT);
+ env->ReleaseFloatArrayElements(j_pts2, pts2, JNI_ABORT);
+
+ return (cs != 0);
+ }
+
+
using namespace Renderables;
Index: gzz/gzz/gfx/gl/GL.java
diff -c gzz/gzz/gfx/gl/GL.java:1.13 gzz/gzz/gfx/gl/GL.java:1.14
*** gzz/gzz/gfx/gl/GL.java:1.13 Mon Oct 14 14:15:19 2002
--- gzz/gzz/gfx/gl/GL.java Sat Oct 19 10:26:36 2002
***************
*** 729,734 ****
--- 729,739 ----
public static native boolean transform(int ninds, int[] inds, float[] pts,
int coordsys, boolean inverse, float[] points, float[]into);
+ public static native boolean transform2(int ninds, int[] inds, float[]
pts,
+ int[] interpinds, int[] inds2, float[] pts2, float
fract,
+ boolean show1,
+ int coordsys, boolean inverse, float[] points, float[]into);
+
/** Process native events.
* @param wait If false, this function will return once there are no more
* native events to process. If true, this function will
wait
Index: gzz/gzz/gfx/gl/GLVobCoorder.java
diff -c gzz/gzz/gfx/gl/GLVobCoorder.java:1.43
gzz/gzz/gfx/gl/GLVobCoorder.java:1.44
*** gzz/gzz/gfx/gl/GLVobCoorder.java:1.43 Tue Oct 15 11:00:38 2002
--- gzz/gzz/gfx/gl/GLVobCoorder.java Sat Oct 19 10:26:36 2002
***************
*** 29,35 ****
import gzz.client.gl.*;
public class GLVobCoorder extends AffineVobCoorder {
! public static final String rcsid = "$Id: GLVobCoorder.java,v 1.43 2002/10/15
15:00:38 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
--- 29,35 ----
import gzz.client.gl.*;
public class GLVobCoorder extends AffineVobCoorder {
! public static final String rcsid = "$Id: GLVobCoorder.java,v 1.44 2002/10/19
14:26:36 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
***************
*** 283,287 ****
--- 283,303 ----
return GL.transform(ninds, inds, floats,
withCS, true, points, into);
}
+
+ public boolean transformPoints3_interp(int[] interpList, GLVobCoorder
other,
+ float fract, boolean show1,
+ int withCS, float[] points, float[]into) {
+ return GL.transform2(ninds, inds, floats,
+ interpList, other.inds, other.floats,
+ fract, show1, withCS, false, points, into);
+ }
+ public boolean inverseTransformPoints3_interp(int[] interpList,
GLVobCoorder other,
+ float fract, boolean show1,
+ int withCS, float[] points, float[]into) {
+ return GL.transform2(ninds, inds, floats,
+ interpList, other.inds, other.floats,
+ fract, show1, withCS, true, points, into);
+ }
+
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz gfx/jni/GzzGL-jni.cxx gzz/gfx/gl/GL.java gz...,
Tuomas J. Lukka <=