Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / Re: Question about glDrawElements on: 2007-06-20 04:43:29
Hello,

         This is a code where i getting problem
*********
   if (m_Texturing && m_EnvMapOn && normals != null) {
         CQ3DMatrix worldview = new CQ3DMatrix();
         worldview.mul(m_ViewMatrix, m_WorldMatrix);
         for (int i = 0, face = 0; i < nbIndex; i += 3, face++) {
            CQ3DVector normal = new CQ3DVector();

            normal.assign(normals[face]);
            normal.transformNoTrans(worldview);

            if (m_NormalizeNormals) {
               normal.normalize(); // Maybe a scale Huh
            }

            float UV[] = new float[2];

            UV[0] = normal.m_Vector.x * 0.5f + 0.5f;
            UV[1] = normal.m_Vector.y * 0.5f + 0.5f;

            float norm[] = new float[3];
            norm[0] = normals[face].x;
            norm[1] = normals[face].y;
            norm[2] = normals[face].z;

            m_gl.glBegin(GL.GL_TRIANGLES);
            m_gl.glNormal3fv(norm, 0);
            m_gl.glTexCoord3fv(UV, 0);
            norm[0] = vertices[faces[face + faceindex].a].pos.x;
            norm[1] = 0;
            norm[2] = 0;
            m_gl.glVertex3fv(norm, 0);
            norm[0] = vertices[faces[face + faceindex].b].pos.x;
            m_gl.glVertex3fv(norm, 0);
            norm[0] = vertices[faces[face + faceindex].c].pos.x;
            m_gl.glVertex3fv(norm, 0);
            m_gl.glEnd();
         }

      }

      SQ3DVERTEX[] Vertices = prepareVertices(vertices, nbVertices);

      m_gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
      
      FloatBuffer buffer = BufferUtil.newFloatBuffer(Vertices.length * 2);
      if (m_Texturing && !m_GenerateTexCoords) {
         m_gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY);
         for (int Icount = 0; Icount < Vertices.length; Icount++) {
            buffer.put(Vertices[Icount].u);
            buffer.put(Vertices[Icount].v);
         }
         buffer.rewind();
         m_gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, buffer);
      } else {
         m_gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY);
      }

      buffer = BufferUtil.newFloatBuffer(Vertices.length * 3);
      for (int Icount = 0; Icount < Vertices.length; Icount++) {
         buffer.put(Vertices[Icount].pos.x);
         buffer.put(Vertices[Icount].pos.y);
         buffer.put(Vertices[Icount].pos.z);
      }
      buffer.rewind();
      m_gl.glVertexPointer(3, GL.GL_FLOAT, 0, buffer);

      if (normals == null) {
         m_gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
         buffer = BufferUtil.newFloatBuffer(Vertices.length*3);
         for (int Icount = 0; Icount < Vertices.length; Icount++) {
            buffer.put(Vertices[Icount].normal.x);
            buffer.put(Vertices[Icount].normal.y);
            buffer.put(Vertices[Icount].normal.z);
         }
         buffer.rewind();
         m_gl.glNormalPointer(GL.GL_FLOAT, 0, buffer);

         ShortBuffer shBuf = BufferUtil.newShortBuffer(faces.length * 3);
         for (int Icount = faceindex; Icount < faces.length; Icount++) {
            shBuf.put((short) faces[Icount].a);
            shBuf.put((short) faces[Icount].b);
            shBuf.put((short) faces[Icount].c);
         }
         shBuf.rewind();
         
         m_gl.glDrawElements(GL.GL_TRIANGLES, (int) nbIndex,GL.GL_UNSIGNED_SHORT, shBuf);
         //m_gl.glDrawRangeElements(GL.GL_TRIANGLES,0,(int)nbIndex-1,(int)nbIndex,GL.GL_UNSIGNED_SHORT, shBuf);
         m_gl.glDisableClientState(GL.GL_NORMAL_ARRAY);
      } else {
         m_gl.glDisableClientState(GL.GL_NORMAL_ARRAY);
         m_gl.glBegin(GL.GL_TRIANGLES);
         for (int i = 0, face = 0; i < nbIndex; i += 3) {
            buffer.put(0, normals[face].x);
            buffer.put(1, normals[face].y);
            buffer.put(2, normals[face].z);
            m_gl.glNormal3fv(buffer);
            m_gl.glArrayElement(faces[face + faceindex].a);
            m_gl.glArrayElement(faces[face + faceindex].b);
            m_gl.glArrayElement(faces[face + faceindex].c);
            face++;
         }
         m_gl.glEnd();
         m_gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
      }

      m_gl.glDisableClientState(GL.GL_VERTEX_ARRAY);

      if (m_Texturing && !m_GenerateTexCoords) {
         m_gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY);
      }

Regards.
2  Java Game APIs & Engines / JOGL Development / Re: Question about glDrawElements on: 2007-06-19 11:58:30

Hi,
        I have read and done all stuff suggested in given link. Although it does not work.
        Any other solution for that...?

Regards
Patel Vinod
       
3  Java Game APIs & Engines / JOGL Development / Question about glDrawElements on: 2007-06-19 04:42:37

Hi All,

      Any one know, when program can crash by running glDrawElements method. I mean, is there any flag or status that crash the animation program?.

Thanks In Advance,
Vinod Patel
4  Java Game APIs & Engines / JOGL Development / Animation Program Crash on: 2007-06-01 06:39:56

Hello All,

               I am new in openGL. I am developing one animation application. The code of one of the function is shown below. The method written in bold letter results in to JVM crash.

              Is there any other way exists to do the same thing without using the glDrawElements function.

***********************
      if (m_Texturing && m_EnvMapOn && normals != null) {
         CQ3DMatrix worldview = new CQ3DMatrix();
         worldview.mul(m_ViewMatrix, m_WorldMatrix);
         for (int i = 0, face = 0; i < nbIndex; i += 3, face++) {
            CQ3DVector normal = new CQ3DVector();

            normal.assign(normals[face]);
            normal.transformNoTrans(worldview);

            if (m_NormalizeNormals) {
               normal.normalize(); // Maybe a scale Huh
            }

            float UV[] = new float[2];

            UV[0] = normal.m_Vector.x * 0.5f + 0.5f;
            UV[1] = normal.m_Vector.y * 0.5f + 0.5f;

            float norm[] = new float[3];
            norm[0] = normals[face].x;
            norm[1] = normals[face].y;
            norm[2] = normals[face].z;

            m_gl.glBegin(GL.GL_TRIANGLES);
            m_gl.glNormal3fv(norm, 0);
            m_gl.glTexCoord3fv(UV, 0);
            norm[0] = vertices[faces[face + faceindex].a].pos.x;
            norm[1] = 0;
            norm[2] = 0;
            m_gl.glVertex3fv(norm, 0);
            norm[0] = vertices[faces[face + faceindex].b].pos.x;
            m_gl.glVertex3fv(norm, 0);
            norm[0] = vertices[faces[face + faceindex].c].pos.x;
            m_gl.glVertex3fv(norm, 0);
            m_gl.glEnd();
         }
         return 0;
      }

      SQ3DVERTEX[] Vertices = prepareVertices(vertices, nbVertices);

      m_gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
      logger.error("GL_VERTEX_ARRAY is enabled.");
      
      FloatBuffer buffer = BufferUtil.newFloatBuffer(Vertices.length * 2);
      if (m_Texturing && !m_GenerateTexCoords) {
         m_gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY);
         logger.error("GL_TEXTURE_COORD_ARRAY is enabled.");
         for (int Icount = 0; Icount < Vertices.length; Icount++) {
            buffer.put(Vertices[Icount].u);
            buffer.put(Vertices[Icount].v);
         }
         buffer.rewind();
         m_gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, buffer);
      } else {
         m_gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY);
         logger.error("GL_TEXTURE_COORD_ARRAY is disabled.");
      }

      buffer = BufferUtil.newFloatBuffer(Vertices.length * 3);
      for (int Icount = 0; Icount < Vertices.length; Icount++) {
         buffer.put(Vertices[Icount].pos.x);
         buffer.put(Vertices[Icount].pos.y);
         buffer.put(Vertices[Icount].pos.z);
      }
      buffer.rewind();
      m_gl.glVertexPointer(3, GL.GL_FLOAT, 0, buffer);

      if (normals == null) {
         m_gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
         logger.error("GL_NORMAL_ARRAY is enabled.");
         buffer = BufferUtil.newFloatBuffer(Vertices.length);
         for (int Icount = 0; Icount < Vertices.length; Icount++) {
            buffer.put(Vertices[Icount].normal.x);
         }
         buffer.rewind();
         m_gl.glNormalPointer(GL.GL_FLOAT, 0, buffer);

         ShortBuffer shBuf = BufferUtil.newShortBuffer(faces.length * 3);
         for (int Icount = faceindex; Icount < faces.length; Icount++) {
            shBuf.put((short) faces[Icount].a);
            shBuf.put((short) faces[Icount].b);
            shBuf.put((short) faces[Icount].c);
         }
         shBuf.rewind();
         
         m_gl.glDrawElements(GL.GL_TRIANGLES, (int) nbIndex,GL.GL_UNSIGNED_SHORT, shBuf);         m_gl.glDisableClientState(GL.GL_NORMAL_ARRAY);
         logger.error("GL_NORMAL_ARRAY is disabled.");
      } else {
         m_gl.glDisableClientState(GL.GL_NORMAL_ARRAY);
         logger.error("GL_NORMAL_ARRAY is disabled.");
         m_gl.glBegin(GL.GL_TRIANGLES);
         for (int i = 0, face = 0; i < nbIndex; i += 3) {
            buffer.put(0, normals[face].x);
            buffer.put(1, normals[face].y);
            buffer.put(2, normals[face].z);
            m_gl.glNormal3fv(buffer);
            m_gl.glArrayElement(faces[face + faceindex].a);
            m_gl.glArrayElement(faces[face + faceindex].b);
            m_gl.glArrayElement(faces[face + faceindex].c);
            face++;
         }
         m_gl.glEnd();
         m_gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
         logger.error("GL_NORMAL_ARRAY is enabled.");
      }

      m_gl.glDisableClientState(GL.GL_VERTEX_ARRAY);
      logger.error("GL_VERTEX_ARRAY is disabled.");

      if (m_Texturing && !m_GenerateTexCoords) {
         m_gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY);
         logger.error("GL_TEXTURE_COORD_ARRAY is disabled.");
      }
      logger.error("");



******************

Regards
Vinod Patel
5  Java Game APIs & Engines / JOGL Development / Re: JVM crash while running JOGL program on: 2007-04-26 10:46:28
But program run for some times then it generates errors so i think that it should not be a problem.
6  Java Game APIs & Engines / JOGL Development / Re: JVM crash while running JOGL program on: 2007-04-23 03:35:47
Yes, i am rewinding the buffer before passing it to the method.
7  Java Game APIs & Engines / JOGL Development / JVM crash while running JOGL program on: 2007-04-21 10:30:17
Dear All,

           I am working in JOGL 3D Application. Application runs successful. I run same code repeatedly to run animation. Code work successfully for some number of iteration. But after many iteration i get critical error. The error is not like exception but creates a file representing memeory addresses. Here i paste that generated file.

******************************************************************************************************************

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0559ed43, pid=2504, tid=3672
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode, sharing)
# Problematic frame:
# C  0x0559ed43
#

---------------  T H R E A D  ---------------

Current thread (0x05042fd8):  JavaThread "AWT-EventQueue-1" [_thread_in_native, id=3672]

siginfo: ExceptionCode=0xc0000005, reading address 0x05278000

Registers:
EAX=0x05278000, EBX=0x00000000, ECX=0x055bb0b0, EDX=0x05279000
ESP=0x054cf2a8, EBP=0x00000001, ESI=0x0527a000, EDI=0x055c0020
EIP=0x0559ed43, EFLAGS=0x00010202

Top of Stack: (sp=0x054cf2a8)
0x054cf2a8:   05279000 0527a000 055c0020 00000001
0x054cf2b8:   054cf2fc 000d0488 00000000 00000000
0x054cf2c8:   000d0488 690dd40f 00000000 00000001
0x054cf2d8:   0563be68 000d0488 690dcfce 00000000
0x054cf2e8:   00000001 000000d0 000d0488 000000c0
0x054cf2f8:   00000000 054cf348 690df29a 00000000
0x054cf308:   000000c0 0563be68 0000030c 0563be68
0x054cf318:   000d0488 000d0488 00000000 00000000

Instructions: (pc=0x0559ed43)
0x0559ed33:   79 30 8b 6c 24 1c 55 57 56 52 8b 05 ac b0 57 05
0x0559ed43:   8b 18 89 5f 70 8b 58 04 89 5f 74 c7 47 78 00 00


Stack: [0x05490000,0x054d0000),  sp=0x054cf2a8,  free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x0559ed43

[error occurred during error reporting, step 120, id 0xc0000005]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J  com.sun.opengl.impl.GLImpl.glDrawElements0(IIILjava/lang/Object;I)V
J  com.sun.opengl.impl.GLImpl.glDrawElements(IIILjava/nio/Buffer;)V
..............other stack trace
---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x0534c100 JavaThread "Keep-Alive-Timer" daemon [_thread_blocked, id=1020]
  0x04f98048 JavaThread "Thread-4" [_thread_blocked, id=4068]
=>0x05042fd8 JavaThread "AWT-EventQueue-1" [_thread_in_native, id=3672]
  0x02e46710 JavaThread "TimerQueue" daemon [_thread_blocked, id=1152]
  0x003566e0 JavaThread "DestroyJavaVM" [_thread_blocked, id=3844]
  0x05020cd8 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=2184]
  0x04f984f8 JavaThread "thread applet-com.qedsoft.player.impl.CRealStreamPlayer.class" [_thread_blocked, id=508]
  0x02c82180 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2396]
  0x02c81d60 JavaThread "AWT-Shutdown" [_thread_blocked, id=2792]
  0x02c80cb8 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=2132]
  0x00a11bb0 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3988]
  0x00a10790 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3524]
  0x00a0fb08 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3264]
  0x009e2b20 JavaThread "Finalizer" daemon [_thread_blocked, id=2968]
  0x0035fb30 JavaThread "Reference Handler" daemon [_thread_blocked, id=2608]

Other Threads:
  0x009e0cb0 VMThread [id=1612]
  0x00a12e08 WatcherThread [id=1628]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 576K, used 10K [0x22a70000, 0x22b10000, 0x22f50000)
  eden space 512K,   2% used [0x22a70000, 0x22a72b30, 0x22af0000)
  from space 64K,   0% used [0x22b00000, 0x22b00000, 0x22b10000)
  to   space 64K,   0% used [0x22af0000, 0x22af0000, 0x22b00000)
 tenured generation   total 5408K, used 3108K [0x22f50000, 0x23498000, 0x26a70000)
   the space 5408K,  57% used [0x22f50000, 0x23259118, 0x23259200, 0x23498000)
 compacting perm gen  total 8192K, used 3760K [0x26a70000, 0x27270000, 0x2aa70000)
   the space 8192K,  45% used [0x26a70000, 0x26e1c2b0, 0x26e1c400, 0x27270000)
    ro space 8192K,  63% used [0x2aa70000, 0x2af7f230, 0x2af7f400, 0x2b270000)
    rw space 12288K,  46% used [0x2b270000, 0x2b811670, 0x2b811800, 0x2be70000)

Dynamic libraries:
0x00400000 - 0x0040d000    C:\Program Files\Java\jre1.5.0_11\bin\javaw.exe
0x7c900000 - 0x7c9b0000    C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f4000    C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000    C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f01000    C:\WINDOWS\system32\RPCRT4.dll
0x7e410000 - 0x7e4a0000    C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f57000    C:\WINDOWS\system32\GDI32.dll
0x77c10000 - 0x77c68000    C:\WINDOWS\system32\MSVCRT.dll
0x76390000 - 0x763ad000    C:\WINDOWS\system32\IMM32.DLL
0x6d640000 - 0x6d7dd000    C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll
0x76b40000 - 0x76b6d000    C:\WINDOWS\system32\WINMM.dll
0x6d290000 - 0x6d298000    C:\Program Files\Java\jre1.5.0_11\bin\hpi.dll
0x76bf0000 - 0x76bfb000    C:\WINDOWS\system32\PSAPI.DLL
0x6d610000 - 0x6d61c000    C:\Program Files\Java\jre1.5.0_11\bin\verify.dll
0x6d310000 - 0x6d32d000    C:\Program Files\Java\jre1.5.0_11\bin\java.dll
0x6d630000 - 0x6d63f000    C:\Program Files\Java\jre1.5.0_11\bin\zip.dll
0x6d000000 - 0x6d16a000    C:\Program Files\Java\jre1.5.0_11\bin\awt.dll
0x73000000 - 0x73026000    C:\WINDOWS\system32\WINSPOOL.DRV
0x774e0000 - 0x7761d000    C:\WINDOWS\system32\ole32.dll
0x73760000 - 0x737a9000    C:\WINDOWS\system32\ddraw.dll
0x73bc0000 - 0x73bc6000    C:\WINDOWS\system32\DCIMAN32.dll
0x6d240000 - 0x6d290000    C:\Program Files\Java\jre1.5.0_11\bin\fontmanager.dll
0x74720000 - 0x7476b000    C:\WINDOWS\system32\MSCTF.dll
0x755c0000 - 0x755ee000    C:\WINDOWS\system32\msctfime.ime
0x6d4d0000 - 0x6d4e3000    C:\Program Files\Java\jre1.5.0_11\bin\net.dll
0x71ab0000 - 0x71ac7000    C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000    C:\WINDOWS\system32\WS2HELP.dll
0x6d4f0000 - 0x6d4f9000    C:\Program Files\Java\jre1.5.0_11\bin\nio.dll
0x7c9c0000 - 0x7d1d5000    C:\WINDOWS\system32\shell32.dll
0x77f60000 - 0x77fd6000    C:\WINDOWS\system32\SHLWAPI.dll
0x773d0000 - 0x774d3000    C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll
0x5d090000 - 0x5d12a000    C:\WINDOWS\system32\comctl32.dll
0x10000000 - 0x1004d000    C:\Program Files\Java\jre1.5.0_11\bin\jogl.dll
0x5ed00000 - 0x5edcc000    C:\WINDOWS\system32\OPENGL32.dll
0x68b20000 - 0x68b40000    C:\WINDOWS\system32\GLU32.dll
0x6d370000 - 0x6d376000    C:\Program Files\Java\jre1.5.0_11\bin\jawt.dll
0x05380000 - 0x05385000    C:\Program Files\Java\jre1.5.0_11\bin\jogl_awt.dll
0x69000000 - 0x692e9000    C:\WINDOWS\system32\vticd.dll
0x71a50000 - 0x71a8f000    C:\WINDOWS\System32\mswsock.dll
0x76f20000 - 0x76f47000    C:\WINDOWS\system32\DNSAPI.dll
0x76fb0000 - 0x76fb8000    C:\WINDOWS\System32\winrnr.dll
0x76f60000 - 0x76f8c000    C:\WINDOWS\system32\WLDAP32.dll
0x76fc0000 - 0x76fc6000    C:\WINDOWS\system32\rasadhlp.dll
0x662b0000 - 0x66308000    C:\WINDOWS\system32\hnetcfg.dll
0x71a90000 - 0x71a98000    C:\WINDOWS\System32\wshtcpip.dll
0x6d190000 - 0x6d1bf000    C:\Program Files\Java\jre1.5.0_11\bin\cmm.dll
0x6d3d0000 - 0x6d3ef000    C:\Program Files\Java\jre1.5.0_11\bin\jpeg.dll
0x4b080000 - 0x4b08d000    C:\PROGRA~1\1-CLIC~1\agthook.dll
0x4b280000 - 0x4b302000    C:\PROGRA~1\1-CLIC~1\agtctrl.dll
0x4ba80000 - 0x4ba87000    C:\PROGRA~1\1-CLIC~1\agtthook.dll
0x4b480000 - 0x4b584000    C:\PROGRA~1\1-CLIC~1\agtpchnt.dll
0x4b680000 - 0x4b687000    C:\PROGRA~1\1-CLIC~1\agtcmpnt.dll
0x4b880000 - 0x4b888000    C:\PROGRA~1\1-CLIC~1\agtproc.dll

VM Arguments:
jvm_args: -Djava.security.policy=java.policy.applet
java_command: sun.applet.AppletViewer com.qedsoft.player.impl.CRealStreamPlayer1177150881486.html
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\backburner 2\;C:\Program Files\Autodesk\Backburner\;C:\Program Files\jEdit;C:\PROGRA~1\ULTRAE~1;C:\Program Files\Java\jdk1.5.0_11\bin;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\apache-ant-1.6.1\bin
USERNAME=vinod
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 1, GenuineIntel



---------------  S Y S T E M  ---------------

OS: Windows XP Build 2600 Service Pack 2

CPU:total 1 (cores per cpu 1, threads per core 1) family 15 model 4 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3

Memory: 4k page, physical 507184k(101684k free), swap 2471952k(1958240k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_11-b03) for windows-x86, built on Dec 15 2006 01:16:12 by "java_re" with MS VC++ 6.0





**************************************************************************************************************

I don't understand actual problem.
If any one know the problem and solution please suggest me the way.
Small help will be appreciated for me.

Thanks In Advance
Patel Vinod
8  Java Game APIs & Engines / JOGL Development / Re: Threading problem in JOGL on: 2007-04-18 03:53:09

Dear cylab,

                There is no strong reason to use thread but existing C++ 3D application run OpenGL animation using thread. I want to keep same application architecture as c++. Because c++ application architecture is very good and i want same in Java.
 
               If possible, please give one example to run animation usiing thread.

Thanks
Vinod Patel
9  Java Game APIs & Engines / JOGL Development / Threading problem in JOGL on: 2007-04-17 11:24:29


Dear All,

               I have a threading problem while running a JOGL program. When i use Animator of JOGL, it calls display method frequently. In display method i have cleared background and rendered some text. With animator it works fine.

              But when i put same code in thread it does not work.

              Can anyone explain me by giving example ?.
              Any short example will be appreciated me using thread.

Thanks In Advance.
Vinod
             
10  Java Game APIs & Engines / JOGL Development / Re: Convert a JPEG file in to BMP(BitMap) on: 2007-04-12 09:40:45
 Thanks,

            I have tried using same but whatever i am getting is different from my existing c++ code. I have existing c++ library that decompress JPEG data. Know i want to convert it in to java.
11  Java Game APIs & Engines / JOGL Development / Convert a JPEG file in to BMP(BitMap) on: 2007-04-12 07:23:34


Dear All,

           I have a problem of converting a JPEG file in to BMP file. I have a array of bytes created from JPEG file. I mean whole file bytes are readed in to array. Know i want to convert that array in to bitmap (BMP) file.

Thanks In Advance.
12  Java Game APIs & Engines / JOGL Development / Re: JOGL Exception while running program on: 2007-04-11 12:07:38


Thanks a lot.

I have created direct buffer by using BufferUtil class of JOGL. It has various static methods to create long, float, short direct buffers.
13  Java Game APIs & Engines / JOGL Development / Re: JOGL Exception while running program on: 2007-04-11 06:46:52


Dear Ultraq,

   Thanks for reply.

   But there is no method  allocateDirect in FloatBuffer class. That method exits only in ByteBuffer class.
   I am using float data rather than byte.

 Thanks in Advance.
14  Java Game APIs & Engines / JOGL Development / JOGL Exception while running program on: 2007-04-11 05:51:33


Dear All,

              I had written a following code but it gives me an exception.

if(m_Texturing && m_EnvMapOn && normals!=null){
         CQ3DMatrix worldview = new CQ3DMatrix();
         worldview.mul(m_ViewMatrix, m_WorldMatrix);
         for (int i=0, face=0; i < nbIndex;  i+=3, face++){
            CQ3DVector normal = new CQ3DVector();
            
            normal.assign(normals[face]);
            normal.transformNoTrans(worldview);
            
            if (m_NormalizeNormals){
               normal.normalize();      //   Maybe a scale Huh
            }
            
            float UV[] = new float[2];
            
            UV[0] = normal.m_Vector.x * 0.5f + 0.5f;
            UV[1] = normal.m_Vector.y * 0.5f + 0.5f;
            
            float norm []= new float[3];
            norm[0] = normals[face].x;
            norm[1] = normals[face].y;
            norm[2] = normals[face].z;
            
            m_gl.glBegin(GL.GL_TRIANGLES);
               m_gl.glNormal3fv(norm,0);
               m_gl.glTexCoord3fv(UV,0);
               norm[0] = vertices[faces[face+faceindex].a].pos.x;
               norm[1] = 0;
               norm[2] = 0;
               m_gl.glVertex3fv(norm,0);
               norm[0] = vertices[faces[face+faceindex].b].pos.x;
               m_gl.glVertex3fv(norm,0);
               norm[0] = vertices[faces[face+faceindex].c].pos.x;
               m_gl.glVertex3fv(norm,0);
            m_gl.glEnd();
            glError(m_gl.glGetError());
         }
         return QEDResponseCode.Q3D_RENDERER_OK;
      }
      
      SQ3DVERTEX [] Vertices = prepareVertices(vertices, nbVertices);
      
      m_gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
      glError(m_gl.glGetError());
      
      FloatBuffer buffer = FloatBuffer.allocate(3);
      if(m_Texturing && !m_GenerateTexCoords){
         m_gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY);
         glError(m_gl.glGetError());
         buffer.put(0,Vertices[0].u);
         buffer.put(0,Vertices[1].v);
         buffer.position(0);
         m_gl.glTexCoordPointer(2,GL.GL_FLOAT,0,buffer);
         glError(m_gl.glGetError());
      }
      else{
         m_gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY);
         glError(m_gl.glGetError());
      }

      buffer.put(0,Vertices[0].pos.x);
      buffer.put(1,Vertices[0].pos.y);
      buffer.put(2,Vertices[0].pos.z);
      buffer.position(0);
      m_gl.glVertexPointer(3,GL.GL_FLOAT,0,buffer);
      glError(m_gl.glGetError());

      if(normals==null){
         m_gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
         glError(m_gl.glGetError());
         buffer.put(0,Vertices[0].normal.x);
         m_gl.glNormalPointer(GL.GL_FLOAT,0,buffer);
         glError(m_gl.glGetError());

         ShortBuffer shBuf = ShortBuffer.allocate(faces.length*3);
         for(int Icount=faceindex;Icount<faces.length;Icount++){
            shBuf.put((short)faces[Icount].a);
            shBuf.put((short)faces[Icount].b);
            shBuf.put((short)faces[Icount].c);
         }
         
         shBuf.position(0);
         m_gl.glDrawElements(GL.GL_TRIANGLES,(int) nbIndex,GL.GL_UNSIGNED_SHORT,shBuf);
         glError(m_gl.glGetError());

         m_gl.glDisableClientState(GL.GL_NORMAL_ARRAY);
         glError(m_gl.glGetError());
      }
      else{
         m_gl.glDisableClientState(GL.GL_NORMAL_ARRAY);
         glError(m_gl.glGetError());
         m_gl.glBegin(GL.GL_TRIANGLES);
               int i;
               int face;
               for(i=0, face=0 ; i<nbIndex; i+=3){
                  buffer.put(0,normals[face].x);
                  buffer.put(1,normals[face].y);
                  buffer.put(2,normals[face].z);
                  m_gl.glNormal3fv(buffer);
                  m_gl.glArrayElement(faces[face+faceindex].a);
                  m_gl.glArrayElement(faces[face+faceindex].b);
                  m_gl.glArrayElement(faces[face+faceindex].c);
                  face++;
               }
            m_gl.glEnd();
            glError(m_gl.glGetError());
            
         m_gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
         glError(m_gl.glGetError());
      }
      
      m_gl.glDisableClientState(GL.GL_VERTEX_ARRAY);
      glError(m_gl.glGetError());

      if(m_Texturing && !m_GenerateTexCoords){
         m_gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY);
         glError(m_gl.glGetError());
      }

                     And the exception i am getting is

Caused by: javax.media.opengl.GLException: Argument "ptr" was not a direct buffer
   at com.sun.opengl.impl.GLImpl.glVertexPointer(GLImpl.java:27940)
   at javax.media.opengl.DebugGL.glVertexPointer(DebugGL.java:11682)
   at com.qedsoft.renderer.abstractfile.renderer.impl.CQ3DRendererOpenGL.drawFacesByIndexFlat(CQ3DRendererOpenGL.java:1083)
   at com.qedsoft.renderer.abstractfile.renderer.impl.CQ3DRendererOpenGL.drawFacesByIndex(CQ3DRendererOpenGL.java:1015)


                     Line number 1083 is what i have saw bold in given code.

                     Please let me know what the problem is ?.......
                     

Thanks To All in Advance.
15  Java Game APIs & Engines / JOGL Development / JOGL problem with thread on: 2007-04-11 05:45:35
Dear All,

            I am new in JOGL. I have a problem with running JOGL program in thread.
            I have created a thread in display method of the GLEventListener implementation class. This thread renders a text in the GLCanvas. But it does not working.

           But, if i put same thing in display method and use Animator for repeated display of text it works fine. I don't understand what the problem is?.

           Please help me if possible.

           Thanks in Advance..........
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (35 views)
2014-12-15 09:26:44

Mr.CodeIt (26 views)
2014-12-14 19:50:38

BurntPizza (60 views)
2014-12-09 22:41:13

BurntPizza (95 views)
2014-12-08 04:46:31

JscottyBieshaar (55 views)
2014-12-05 12:39:02

SHC (71 views)
2014-12-03 16:27:13

CopyableCougar4 (73 views)
2014-11-29 21:32:03

toopeicgaming1999 (133 views)
2014-11-26 15:22:04

toopeicgaming1999 (124 views)
2014-11-26 15:20:36

toopeicgaming1999 (34 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!