Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
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: glrotation to vectors on: 2011-05-31 20:56:37
i am haaaappppyyyyy Wink

now i really understand this system Smiley


its ALL working perfect..and i can start with my mad space sim idea Smiley

much thanks for that help Smiley
2  Java Game APIs & Engines / JOGL Development / Re: glrotation to vectors on: 2011-05-31 09:17:14

its working 99.0% Smiley

the only thing is, and that i think is what cylab wrote, is the
Quote
multiply your objects vertices
.

my camera is not interacting with the objects like it does before.
My old code was looking like that:

glu.glulookat for camera
...
push matrix
rotate ..
rotate...
translate
callList(xyz)
pop matrix

now i replaced the rotate ... with the set_rota funktion (see code)
when i got my camera fixed ( glu.gluLookAt(0,0,1,  0,0,0,  0,1,0);
the object is working perfect with the vector rotations.

when now putting the vectors in the lookat funktion for the camera
they make an twice rotation and the object is always in front of me.

greetings Smiley

// Paint object with vector offset 0
1  
2  
3  
4  
5  
        gl.glPushMatrix();
        texture[9].bind();
        set_rota(drawable, 0);   //  build matrix from vector set 0
       gl.glCallList(2005);
        gl.glPopMatrix();


// My build matrix from vector method
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
public void set_rota(GLAutoDrawable drawable,int off)
{
   GL2 gl = drawable.getGL().getGL2();

   float flc=0.0f;
   
   FloatBuffer matrix2  = FloatBuffer.allocate(16);
   matrix2.rewind();
   
   flc=(float) vector[off+3] ;matrix2.put(flc);
   flc=(float) vector[off+4] ;matrix2.put(flc);
   flc=(float) vector[off+5] ;matrix2.put(flc);
   flc=0.000000f             ;matrix2.put(flc);
   
   flc=(float) vector[off+6] ;matrix2.put(flc);
   flc=(float) vector[off+7] ;matrix2.put(flc);
   flc=(float) vector[off+8] ;matrix2.put(flc);
   flc=0.000000f             ;matrix2.put(flc);
   
   flc=(float) vector[off+0] ;matrix2.put(flc);
   flc=(float) vector[off+1] ;matrix2.put(flc);
   flc=(float) vector[off+2] ;matrix2.put(flc);
   flc=0.000000f             ;matrix2.put(flc);

   flc=(float) 0             ;matrix2.put(flc);
   flc=(float) 0             ;matrix2.put(flc);
   flc=(float) -10           ;matrix2.put(flc);
   flc=1.000000f             ;matrix2.put(flc);
 
   
   matrix2.rewind();    
   
   gl.glLoadMatrixf(matrix2);
   


// My Camera Setup
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
    public void setcamera(GLAutoDrawable drawable,int was)
    {
    GL2 gl = drawable.getGL().getGL2();
    GLU glu = new GLU();

    gl.glMatrixMode(GL2.GL_PROJECTION);
    gl.glLoadIdentity();

     float pvi=35.0f;  
     float near=0.1f;
     float far=50000.0f;
     float asp = (float)screen_x / (float)screen_y;
     if (asp==0) asp=1;


    glu.gluPerspective( pvi, asp, near,far );
    gl.glMatrixMode(GL2.GL_MODELVIEW);
    gl.glLoadIdentity();


   glu.gluLookAt(vector[0],vector[1],vector[2],   //look from
                     0,0,0,                                    //look to zero
                     vector[6],vector[7],vector[8]);  //up vector

3  Java Game APIs & Engines / JOGL Development / Re: glrotation to vectors on: 2011-05-31 00:30:08
omg,

i was looking for the strangest of all calculation-combinations to get the rotation....
(i am not an mathematics expert..i wrote an own vector 3axis rotation for an space sim
..not 100% exactly..but for gaming it works perfect )


and now..simple put the vectors to the matrix..and works... think i need some coffee

thanks alot cylab... Smiley
4  Java Game APIs & Engines / JOGL Development / glrotation to vectors on: 2011-05-30 02:27:47
hello @all,

i got 3 vectors (X;Y;Z) and i need to setup an rotation in opengl/jogl to use this
for drawing objects.

the glu.lookat (0,0,0 ,Vx,Vy,Vz, Ux,Uy,Uz) is doing this perfect for the
camera..but i need this for the objects
(V'xyz= Z Vector , U'xyz is the Y/UP Vector..and i also got an X Vector to the side)

how can i do this ?

thanks for all help Smiley



5  Java Game APIs & Engines / JOGL Development / jogl build problem on: 2011-05-02 22:58:37
hello, i was using an older release build of jogl2 (i586) and was trying to update to an newer build

http://jogamp.org/deployment/autobuilds/master/jogl-b379-2011-04-28_22-30-17/
(and also using b385..with same result)

(copy lib folder and the jogl.all,gluegen-rt.all,newt.all,nativewindow.all)
clean and build:

netbeans 7.0 told me the following kind of error:

fso.texture[lo].bind();  //on old release this was working..is there any change with the .bind command?

->> bind(javax.media.opengl.GL) in com.jogamp.opengl.util.texture.Texture cannot be applied to ()

what did i have to do/change?

is it the right folder to download jogl2?

greetings theri



UPDATE:

i now use the b23 build for amd64 on intel i586 64bit pc..it works
(the i586 is not working)
(http://jogamp.org/deployment/webstart/archive/)
6  Java Game APIs & Engines / JOGL Development / JOGL2 loading mipmap levels on: 2011-03-27 14:55:39
hello @all,

i am working on an textur-atlas landscape with jogl2 (it needs a lot of different textur images on it)
(but i have the textur bleeding thing on the edges..so i try to use own mip-graphics) ,
my question ist how i can manually load with jogl2 my images into the mipmap levels

.....
ground_texture= TextureIO.newTexture(new File("gfx/mip_level0.png"), false); // true for auto mipmap generate
gl.glTexParameterf(GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_MIN_......
.....


how can i load my mip_level1.png into the miplevel 1 of ground_texture...mip_level2.png into level 2 .....

much thanks for all help Smiley  theri




7  Java Game APIs & Engines / JOGL Development / Re: jogl2 GLWindow & exclusive fullscreen on: 2010-07-25 15:33:41
some late response ..

i was also getting this white screen situation with
windows vista/windows 7...  xp was running perfect...

after a while i see that the first rendered screen
appears when clicking mouse..and then black screen/freeze .. i used the robot funktion
to simulate a mouse click one time direct after initialisation of opengl/jogl2..
it was only a simple test...and now it works perfect with it... (on all windows versions)



----------------------------------------------------------------------------------------------
i think its the theory/practice thing

-theory is when someone know how it works..and its not running
-practise is.. its running and nobody knows why...

8  Java Game APIs & Engines / JOGL Development / Re: RenderToTexture Question on: 2010-05-27 08:42:10
omg...

i found what the app disturbed.
-the nvidia desktop manager software eats all vram!
(after deaktivating this program all works fine again
(i use 2 screen ,and got no need of any extra screen manager... must be activated in any way)

thanks for all answers!  Cheesy

(i program on older geforce go7300 notebook... on other hardware the problem didnt exist)
9  Java Game APIs & Engines / JOGL Development / Re: RenderToTexture Question on: 2010-05-27 07:46:16
the rewind sounds good, but didnt work..same error stays.  Cry

i also try to use ...  fbo.reset();  , nothing happend

memory is more that enough...i reduce the number of used textures to
minimum(2 x 256*256) ..nothing happend.

and i got no memory killer arrays in the engine...all very simple

but i am very sure that the
    static IntBuffer fbo              = BufferUtil.newIntBuffer(1);
    static IntBuffer depth          = BufferUtil.newIntBuffer(1);
    static IntBuffer fbo_texture = BufferUtil.newIntBuffer(1);
must be the problem...

10  Java Game APIs & Engines / JOGL Development / Re: RenderToTexture Question on: 2010-05-26 21:43:27
here some infos:
-Djava.library.path="lib" -Xmx1024m -Xms1024m

the application break after the
gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, FSO_ENGINE.fbo.get(0));
line and return with error (see below)

i am not very experienced with such error messages in java
and didnt know what to do.
i take a look at some examples,but all i found was written in c++/opengl
and that could net help me ( my code was working , but monday...)

maybe the IntBuffer could be a problem, is there anything to take care?



Quote
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Thread[AWT-EventQueue-0,6,main] glGetError() returned the following error codes after a call to glBindFramebuffer(<int> 0x8D40, <int> 0x1): GL_OUT_OF_MEMORY ( 1285 0x505),
        at javax.media.opengl.DebugGL2.checkGLGetError(DebugGL2.java:24207)
        at javax.media.opengl.DebugGL2.glBindFramebuffer(DebugGL2.java:9980)
        at org.unterhaltungsuniversum.OPEN_GL.initializeFBO(OPEN_GL.java:1125)
        at org.unterhaltungsuniversum.FSO_ENGINE.init(FSO_ENGINE.java:994)
        at com.sun.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:88)
        at javax.media.opengl.awt.GLCanvas$InitAction.run(GLCanvas.java:603)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:149)
        at javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:553)
        at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:290)
        at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:368)
        at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
        at sun.awt.RepaintArea.paint(RepaintArea.java:224)
        at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:301)
        at java.awt.Component.dispatchEventImpl(Component.java:4489)
        at java.awt.Component.dispatchEvent(Component.java:4243)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
11  Java Game APIs & Engines / JOGL Development / RenderToTexture Question on: 2010-05-26 08:56:46
hello @all,

i got an strange problem with the fbo's since a short time,
it was working a long time but yesterday the code stops with an out_of_memory.
the only thing that changed was an update of java.


i dont know if my code was unstable or is there any other method?

much greetings and thanks for any help Smiley


Quote
 

import com.sun.opengl.util.FBObject;
...

   static IntBuffer fbo         = BufferUtil.newIntBuffer(1);
   static IntBuffer depth       = BufferUtil.newIntBuffer(1);
   static IntBuffer fbo_texture = BufferUtil.newIntBuffer(1);
...


static void initializeFBO(GLAutoDrawable drawable,int width, int height)
    {
   
                GL2 gl = drawable.getGL().getGL2();

                gl.glGenFramebuffers(1, FSO_ENGINE.fbo);
!->>           gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, FSO_ENGINE.fbo.get(0));  << -at this point the app gets memory error!
           gl.glGenRenderbuffers(1, FSO_ENGINE.depth);

               
           gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, FSO_ENGINE.depth.get(0));
           gl.glRenderbufferStorage(GL2.GL_RENDERBUFFER, GL2.GL_DEPTH_COMPONENT24, width, height);
           gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, 0);
           gl.glFramebufferRenderbuffer(GL2.GL_FRAMEBUFFER, GL2.GL_DEPTH_ATTACHMENT, GL2.GL_RENDERBUFFER, FSO_ENGINE.depth.get(0));
           gl.glGenTextures(1, FSO_ENGINE.fbo_texture);
           gl.glBindTexture(GL.GL_TEXTURE_2D, FSO_ENGINE.fbo_texture.get(0));
           gl.glTexParameteri(GL.GL_TEXTURE_2D, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);
           gl.glTexParameteri(GL.GL_TEXTURE_2D, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);
                gl.glTexParameterf(GL.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_S    , GL2.GL_CLAMP);
        gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T     , GL2.GL_CLAMP);

                gl.glTexParameterf(GL.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_S    , GL2.GL_CLAMP_TO_EDGE);
        gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T     , GL2.GL_CLAMP_TO_EDGE);

           gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_REPLACE);
           gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, wid,hei, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, null);
           gl.glViewport(0,0,width,height);
...
...
...
12  Java Game APIs & Engines / JOGL Development / Re: Basic question about Jogl on: 2010-05-01 15:41:22
hello bienator,

thank you for that direct infos..

you save my day... i dont need to switch from jogl to something else...

much thanks to you!
13  Java Game APIs & Engines / JOGL Development / Basic question about Jogl on: 2010-05-01 13:44:47
Hello @all,

i am a bit confused about jogl.. i like it very much..its easy to use and
my project now runs perfect after some startproblems.
(jogl/java is a perfect combination of develop a multiplatform 3d game)

but my question is:is jogl frozen or dead or what is with jogl/jogl2..is it
from sun or belongs to someone else..can i still use it for bigger projects..
will the develompemt of jogl continue?

so much different reports.. and jocl... is it another name for "jogl"?

hope someone can explain it a bit to me ?

much greetings theri


 
14  Java Game APIs & Engines / JOGL Development / Fullscreen Problem VISTA/XP on: 2010-03-09 09:46:33
Hi,  i am using Jogl2 and got a little problem with the fullscreen mode (specially at vista)

first i got first the same problem with the white screen and stopped application at vista
when trying fullscreen mode.

i modify the code that it runs in an very bad way...but it runs..

when starting the application i get "black" screen..but the application is running (i hear sound effects for controlling).
now i need to (alt-tab) to the background/desktop of vista..and then switch (alt-tab) back to the
application..now it runs absolut good.

can anybody take a quick look at my init code what i am doing wrong?
(its not cleanup and the window mode is not used at moment)

thanks for any help Smiley


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
public static void main(String[] args) {


        Frame frame = new Frame("FSO");

       frame.setVisible(false);

        Cursor invisibleCursor = Toolkit.getDefaultToolkit().
        createCustomCursor(Toolkit.getDefaultToolkit().getImage(""), new Point(0,0), "invisibleCursor");

        //Maus Cursor verstecken!
       //frame.setCursor(invisibleCursor);

        screenWidth    = Toolkit.getDefaultToolkit().getScreenSize().width;
   screenHeight   = Toolkit.getDefaultToolkit().getScreenSize().height;

        GLCapabilities capabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2));

        capabilities.setNumSamples(2);
        capabilities.setSampleBuffers(true);

        GLCanvas canvas = new GLCanvas(capabilities);

        animator = new Animator(canvas);

        canvas.addGLEventListener(new FSO_ENGINE());
 

     
        System.out.println("Vollbildmodusverf├╝gbar :? "+GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().isFullScreenSupported());
        System.out.println("Refresh :? "+GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getRefreshRate());
        System.out.println("Bitdepth :? "+GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getBitDepth());
        System.out.println("Width :? "+GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth());
        System.out.println("Height :? "+GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight());



       screenWidth=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth();
       screenHeight=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight();
    screen_x=screenWidth;
       screen_y=screenHeight;


           frame.add(canvas);


           System.out.println("isActive :? "+ frame.isActive());

           frame.addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                new Thread(new Runnable() {

                    public void run() {
                         animator.stop();
                         System.exit(0);
                    }
                }).start();
            }
        });
       
        canvas.addKeyListener(new FSO_ENGINE());
        canvas.addMouseListener(new FSO_ENGINE());
        canvas.addMouseWheelListener(new FSO_ENGINE());
        canvas.addMouseMotionListener(new FSO_ENGINE());



       
        frame.setUndecorated(true);    
        frame.setSize(screen_x, screen_y);

        frame.setLocationRelativeTo(null);
       
       
        GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(frame);
        GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setDisplayMode((new DisplayMode(screen_x,screen_y, 32, 60)));
       canvas.requestFocus();

        canvas.setFocusable(true);
       
       canvas.setVisible(true);


//FramebufferObject Size
fbo_width =(int) (screen_x*0.25f);
fbo_height=(int) (screen_y*0.25f);


 
//i try every stuff i find to get focus
frame.pack();
frame.setVisible(true);
   
canvas.display();
canvas.requestFocus();
frame.requestFocus();


       
Thread.yield();
animator.start();

}



15  Java Game APIs & Engines / JOGL Development / Jogl2 Netbeans8 Problems on: 2010-01-05 09:13:41
Hello @all,

i got a lot of problems with Jogl2. i was using netbeans 6.7 and i dont know where i loaded the
plugin for jogl2 and the projects were working (inside the IDE).
now i came to the bad idea to make the projects to run outside the ide..bad idea...

when i was using jogl1 i got after using the build functions some folder with
dist_solaris,dist_windows..etc..inside this folders the jars where running without any problem
(the -Xmx -Xms is not a problem)

now i got only a dist folder..and i cannot start it.

this night i came to the next bad idea...install netbeans 8 und load from the netbeans site the jogl plugin again..
the problems stays..plus: there is no jogl2

there is a kenai site there are some download files..but i ont know what to load there
(i miss something lite a "latest release with everything inside zip")

my nightmare... with netbeans 6.5 i got also a reinstall problem with jogl1...after trying to remove
jogl and reinstall it the netbeans was not working anymore.. need complete reinstall.


my goal..
a simple OPENGL (jogl2) application (no webstart)
that is running without netbeans

like compile and run


can anybody help me please?











16  Java Game APIs & Engines / JOGL Development / Re: Need little help getting startet on: 2008-03-28 10:46:18
thanks for your reply Smiley

i am still a bit confused,cause i think i am too new to this stuff.

i try tour code,but i didnt get it to run to see how it works





17  Java Game APIs & Engines / JOGL Development / Need little help getting startet on: 2008-03-28 10:14:05
Hello, i hope i am right here..
i was coding c++ and actionscript, but for games i need an
openGL system...but i am not very expericened in the java.

i found jogl/java(eclipse) and installed it..first 2 example on the wiki
work perfekt but i got some litte questions about it.
But a little thing i cant find in the tutorials.

you see in the code, i try a bit helpless
to use an call for an renderer loop to the opengl thing,
but i dont know how to access/handle it .
i know that every opengl things must be in the->
"class SceneView implements GLEventListener"
but how can i implement a render loop call
to update the scene every frame.


thanks for any help Smiley     (and sorry for my bad english)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
import javax.swing.*;
import javax.media.opengl.*;
import com.sun.opengl.util.GLUT;
import java.awt.geom.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import com.sun.opengl.util.texture.*;

import java.applet.*;
import java.awt.*;

public class fso extends JFrame
{
  GLCanvas canvas;      

  static Thread t = null;
  static int i=0;
 
 
  public fso()
  {
    GLCapabilities cap = new GLCapabilities();
   
    canvas = new GLCanvas(cap);

    canvas.addGLEventListener(new SceneView());
   
    getContentPane().add(canvas);
   
    setTitle("Game Scene");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(900, 600);
    setVisible(true);  
   
   

   
  }

  public static void run()
  {
   
       while(true)
       {
         i++;
         renderer();  //  i want to refresh the opengl frame and this call is surly wrong
   
         try {
           t.sleep(1000/30);
         } catch (InterruptedException e) { ; }
       }
       
  }


  private static void renderer() {
// i think here i am wrong...

   // TODO Auto-generated method stub
}


class SceneView implements GLEventListener
  {

   
     
   public void init(GLAutoDrawable arg0)
    {
      GL gl = arg0.getGL();
      float l_position[] = {100.0f, 100.0f, 200.0f, 1.0f};
 
      gl.glEnable(GL.GL_LIGHTING);
      gl.glEnable(GL.GL_LIGHT0);
      gl.glEnable(GL.GL_COLOR_MATERIAL);
      gl.glEnable(GL.GL_DEPTH_TEST);
      gl.glEnable(GL.GL_NORMALIZE);
      gl.glEnable(GL.GL_POLYGON_SMOOTH);
      gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, l_position, 0);  
 
      gl.glClearColor(0.7f, 0.7f, 0.7f, 0.0f);
                 
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glOrtho(-100, 100, -100, 100, -100, 100);
      int i=120;
 
      gl.glMatrixMode(GL.GL_MODELVIEW);
      gl.glRotatef(i, 1.0f, 0.0f, 0.0f);    // Rotation um die x-Achse
     gl.glRotatef(-25.0f, 0.0f, 1.0f, 0.0f);   // Rotation um die y-Achse
   }

    public void renderer(GLAutoDrawable arg0)
       {
   // how can i access this renderer from a loop
           //to refresh here the opengl scene..or is there any
           //other predefinded thing in jogl for that?
      }

   
    public void display(GLAutoDrawable arg0)
    {
      GL gl = arg0.getGL();
      GLUT glut =  new GLUT();
           
      gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
      gl.glColor3f(0.2f, 0.0f, 0.3f);
      glut.glutSolidTeapot( 50.0 ) ;
    }


    public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4)
    {
    }


    public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2)
    {
    }
  }


   
  public static void main(String args[])
  {

   //init
   new fso();
    //Main Loop
   run();
   
   
  }
}
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.

xsi3rr4x (50 views)
2014-04-15 18:08:23

BurntPizza (46 views)
2014-04-15 03:46:01

UprightPath (62 views)
2014-04-14 17:39:50

UprightPath (44 views)
2014-04-14 17:35:47

Porlus (61 views)
2014-04-14 15:48:38

tom_mai78101 (84 views)
2014-04-10 04:04:31

BurntPizza (142 views)
2014-04-08 23:06:04

tom_mai78101 (242 views)
2014-04-05 13:34:39

trollwarrior1 (201 views)
2014-04-04 12:06:45

CJLetsGame (208 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!