Login  Register

Re: [JOGL] VBO's not updating

Posted by Al on Jun 03, 2015; 8:51am
URL: https://forum.jogamp.org/JOGL-VBO-s-not-updating-tp4034566p4034594.html

Awesome ! I hope I will too !

Now, My apllications open a blank window and in a menu Project -> Load File, I load my VoelizedObject. Then, the end of the actionPerformed, I instance my animator.

It seems to nothing on the animator is update if the update don't take place at the begginig of the applications, you see ? I can't figure out why...

Do you think it is the problem that Scene is the Canvas And the GLEventListener ? Do I need to change VoxelizedObject to an implements of GLEventLIstener and use the Scene just as Canvas?

I uploaded my changes on the SVN repository. Or I will, you see this post too soon, like 30s after I post it... Whatever =)

EDIT: I forgot to say that I store the indices of the voxel inside a voxel, so I don't have to recalculate it. Same thing to vertices.

Textures

An other thing I want to ask, seeing your screenshot, about textures, I make the most of your help =). How can you use many textures in your shader ? Because shaders manipulates just texCoords right ? If I have all of my voxels in one VBO, I will have some trouble for texturing no ? Will I need to separete Voxel in different VBO's according to textures ?

EDIT AGAIN

if(e.getSource() == Menu.getLoadFile())
                {
                        int returnVal = FileChooser.showOpenDialog(this);
                        if(returnVal == JFileChooser.APPROVE_OPTION)
                        {
                               
                                File file = FileChooser.getSelectedFile();
                                loadFile(file.getAbsolutePath());
                                Scene = new Scene(VoxSample);
                               
                                animator = new Animator(Scene);
                                Scene.addGLEventListener(Scene);
                                this.add(Scene);
                               
                                animator.start();
                                if(animator.isAnimating())
                                        System.err.println("HERE");
                        }
                }

This code runs when I click on the load button of my JFrame;=.
When I run this code that you can see in the repository (maybe not exactly this one but still), nothing is print on the error output, even I started just before. Note that isStarted() doesn't show anything either, and I got no error on the console (except a ugly thing I can't rid of like that "libEGL warning: DRI2: failed to authenticate" )

What do you think about that ?