jogl

How to clip only intersection (not union) of clipping planes?

强颜欢笑 提交于 2020-01-15 05:39:06
问题 In OpenGL/JOGL, when using more than one clipping plane, the union of all clipping planes appears to be applied. What I want is instead the intersection of all clipping planes to be applied. Is this possible? See the below simplified 2-D example. Edit: An example of clipping by vertex shader (see comments below). 回答1: Multi-pass: #include <GL/glut.h> void scene() { glColor3ub( 255, 0, 0 ); glBegin( GL_QUADS ); glVertex2i( -1, -1 ); glVertex2i( 1, -1 ); glVertex2i( 1, 1 ); glVertex2i( -1, 1 );

How would one implement an FPS camera?

强颜欢笑 提交于 2020-01-12 07:03:47
问题 So I'm currently working on some FPS game programming in OpenGL (JOGL, more specifically) just for fun and I wanted to know what would be the recommended way to create an FPS-like camera? At the moment I basically have a vector for the direction the player is facing, which will be added to the current player position upon pressing the "w" or forward key. The negative of that vector is of course used for the "s" or backward key. For "a", left, and "d", right I use the normal of the direction

OpenGL - Pixel color at specific depth

…衆ロ難τιáo~ 提交于 2020-01-11 13:38:06
问题 I have rendered a 3D scene in OpenGL viewed from the gluOrtho perspective. In my application I am looking at the front face of a cube of volume 100x70x60mm (which I have as 1000x700x600 pixels). Inside this cube I have rendered a simple blue sphere which sits exactly in the middle and 'fills' the cube (radius 300 pixels). I now want to read the color value of pixels (in 3D) at specific points within the cube; i.e. I wish to know if say point (100,100,-200) is blue or blank (black).

Jogl, creating only red channel u16 but getting “Texture type and format combination is not valid”

ぐ巨炮叔叔 提交于 2020-01-06 04:54:17
问题 So, I am trying to implement the picking through id. This means with every drawArray a different unique id will be set as uniform and saved in the red component on a texture. 16 bits are more than enough (65k elements), so I choose to use shorts, I know that uniform variable can be only ui, but I decided to gave it a try anyway I also found another question, here, where the answer contains a small example with shorts However here my code to initialize the framebuffer and two textures, one for

Can't find GL.glColor3f in JOGL?

末鹿安然 提交于 2020-01-04 04:30:27
问题 I must be stupid or something, but I'm looking at several JOGL samples online and they use the color3f method of the GL interface in JOGL, but the compiler complains it can't find the method and when I'm checking the javadoc I indeed can't find it: http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/opengl/GL.html So how come there's several samples of code I can find on google that uses GL.glColor3f, but I can't find the method in javadoc? Am I missing something? 回答1:

java.lang.NoClassDefFoundError: com/jogamp/common/type/WriteCloneable jogl 2 in eclipse

谁都会走 提交于 2020-01-02 09:51:33
问题 I am on windows 7 64 bit and using eclipse indigo. I downloaded the latest version of jogl 2 and i have created an eclipse project following this link https://sites.google.com/site/justinscsstuff/jogl-tutorial-2 this tutorial is old as the jars in the jogl download dont match and i have included all the jars and for each jar set the native libraries directory. I have written a small jogl test program that creates a GLProfile, GlCapabilities and an awt frame. I get this exception: java.lang

ivy:install from maven with classifiers

倖福魔咒の 提交于 2020-01-01 09:58:26
问题 I'm trying to ivy:install jogl and gluegen from maven to my local depository. I cannot get the native dependencies to install correctly. My ivysettings is <ivysettings> <settings defaultResolver="central" defaultConflictManager="all" /> <caches defaultCacheDir="${ivy.cache.dir}" artifactPattern="[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]" /> <resolvers> <ibiblio name="central" m2compatible="true" pattern="[organisation]/[module]/[revision]/[artifact]-[revision]

Local alternative to JNLP file?

主宰稳场 提交于 2019-12-29 05:24:06
问题 Try as I might, I can't get a JNLP file to run locally (via a double-click). It seems to be an issue of locating a jar file, even when I specify it relative to the jnlp file. I get the following error: The field <jar>href has an invalid value: helloworld.jar This happens even when the JNLP file is in the same folder as helloworld.jar. I've done searches and this is a consistent problem especially for people who want to package an application on a CD and use JNLP. The only Sun-provided

OpenGl rotations and object movement

我怕爱的太早我们不能终老 提交于 2019-12-25 18:24:01
问题 I'm trying to create a very basic planet movement (sun, earth moon represented as cubes). As for now i managed to move one cube around another, but I have the following question... What will be the best way to move another cube (ex. the moon) around an already moving one? I put them in motion using simple operations ex. for movement on x axis: d * Math.sin(x * Math.PI / 180.0) Where d is the distance from center or projection (dont know if i used this term right). I thought about putting the

Netbeans, Gradle and Jogl, crash

允我心安 提交于 2019-12-24 17:14:37
问题 I am trying to learn and implement Gradle in one of my project. I installed the Netbeans Gradle plugin and after looking a couple of tutorials (and running successfully a couple of test projects), I tried the big step. I successfully solved all the Jogl dependencies modifying the build.gradle script as follow: apply plugin: 'java' sourceCompatibility = '1.8' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' // NetBeans will automatically add "run" and "debug" tasks relying on the //