Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - atreyu64

Pages: [1]
1
Bugs / Changing Near plane leads to weird "reproject" results
« on: March 14, 2016, 12:23:18 am »
Hi boys and boys,

I've noticed a strange behaviour when I modify the near plane value.
In my apps I have two types of camera controls (and I can switch from one to another at any time) : orbit camera and "walk camera" meaning that the camera is very close to the ground, which of course leads to some "frustum" effects.
Here is basically what I do to avoid this problem when I change the camera control type :

Code: [Select]
if(walkMode) {
Config.nearPlane = 0.25f;
Config.farPlane = 10000000000f; // yes I want to see everything...
}
else { // orbit camera settings :
Config.nearPlane = 1f;
Config.farPlane = 1000f;
}
cam.setFOVtoDefault();
cam.adjustFovToNearPlane();

I thought that adjustFovToNearPlane function would be enough but I also had to call setFOVtoDefault to avoid zoom-in/zoom-out effets, but this is not a problem, it solves my frustum problem very well.

The problem is that when the near plane value is different than the default value, the calcMinDistanceAndObject3D method returns wrong results.
Indeed, when I call the following method, I get wrong results :

Code: [Select]
// cursor projection on terrain :
protected SimpleVector getCursorProjection(int x, int y) {
SimpleVector cursorProjection = null;
SimpleVector dir = Interact2D.reproject2D3DWS(cam, fb, x, y).normalize();
Object[] res = world.calcMinDistanceAndObject3D(cam.getPosition(), dir, 1000000);
Object3D pickedObject = (Object3D) res[1];
if(pickedObject == terrain) {
float distance = (Float) res[0];
cursorProjection = dir;
cursorProjection.scalarMul(distance);
cursorProjection.add(cam.getPosition());
}

return cursorProjection;
}

The method still returns something, but it's like if the coordinate system of the frame buffer was different. Maybe the near plane value is not taken into account in the reproject2D3DWS method. Or maybe I'm doing something wrong ?...

Thanks in advance for your answers, cheers,


Sylvain

2
Projects / Rando 3D - Hiking Guide Android Apps (in french)
« on: April 27, 2015, 02:33:32 pm »
Hi,


My apps are finally released !!  8)   ===> https://play.google.com/store/apps/details?id=com.faceausud.aspelescun

The goal was to make an interactive version of already existing mountain hiking maps (on paper), for both PC and Android.
Areas covered are located in the Pyrénées, south-west of France.
Hiking pathes are represented by polylines, and places by billboard planes.
You can see your position and path using the phone GPS, and with the right orientation thanks to magnetometer/accelerometer/gravity sensors. You'll never get lost in the mountain again !  ;)
The Java (PC) version is actually an editor allowing to build a guide from scratch, by placing points of interest, picking paths, ...

App demo video ===> https://www.youtube.com/watch?v=xpeNPrsTxTo

Some technical features :
  • advanced billboard system (rectangular billboards for better picking, billboards have always the same size on the screen whatever their position, ...)
  • advanced blitting GUI (interaction with blitting elements, blitting drag with mouse / touch, buttons magnification, menu animations, blitting tooltips, ... )
  • fast vertical projection on map (using a kind of simple polygon research)
  • custom shader : add color on map depending on the altitude, and display altitude iso lines
  • high resolution texture (4096x4096) available even for android
  • camera : orbit camera, "walkink camera", camera smooth animations, compass-like camera rotation using android sensors, ...
  • atlas system for huge amount of small textures (billboards)

I still have to improve a few things, but it's yet 100% functionnal.
For now only 2 apps (2 different areas) have been released, but new area are comming very soon.


A big thank to Egon, who is of course credited in the app description.
Please add it to your Projects page if you like it.












3
Hi,

I would like to know what are the differences between reduced and non-reduced serialized objects, and also why shouldn't we use reduced objects on desktop program ?

I've noticed that when I use a reduced object on desktop, loading time is faster and the serialized object takes less memory on disk than both obj and non-reduced serialized object. And it works great ! So why should I avoid using it on desktop ?

Thanks in advance, cheers !

4
Support / Maximum Polyline Width ?
« on: December 05, 2014, 01:32:43 pm »
Hi,


I have noticed that on both JPCT and JPCT-AE the polylines are limitted to a maximum width.
This is not really a problem for me on PC because screens all have pretty much the same pixel density. But on android, it's a different story...

So my question is : is there a way to overcome this polyline width limit ?


Thanks in advance, cheers !

5
Support / "Transparent" texture clamping (what ?)
« on: October 14, 2014, 09:51:29 pm »
Hi,


I'm trying to split an object texture into 2x2 parts without modifying the mesh, just by re-asigning UVs.
The problem is about the "border" polygons (which overlap several parts, so they may have several textures), because the result is ugly either with clamping or repeating textures.

Is there a way to make a kind of "invisible" clamping, meaning that UVs outside [0,1] range would be completely transparent ?

I hope what I'm saying make a sens...  :o


Thanks in advance, cheers !

6
Support / Post-processing on a single world
« on: February 27, 2014, 12:57:35 am »
Hi,

I'm trying to make a neon light like effect on some polylines ONLY, using the mighty BloomGLProcessor class.
For this I've created a special world for polylines, which I draw first, then launch post-process, and finally draw my main world.

So basically this is how I'm rendering things :

Code: [Select]
// polylines first :
linesWorld.renderScene(fb);
linesWorld.draw(fb);
bloomProcessor.process();

// main scene :
world.renderScene(fb);
world.draw(fb);

The problem is that I don't get what I expected, the blur effect is not visible after drawing the main world.
Is there a solution ? Thanks in advance !  ;D


Here is my normal scene before trying anything stupid :

Without bloom par atreyu64, sur Flickr

Trying to make the bloom on polyline as explained above :


Polylines and World par atreyu64, sur Flickr

Displaying only the polyline world (with post-processing) :


Polylines only par atreyu64, sur Flickr

What I would like to get (made with Photoshop) :

What I Want par atreyu64, sur Flickr

7
Projects / TopoMap3D - maps for hikers (France)
« on: January 16, 2014, 05:36:05 pm »
Hi there,

Here is a little project which is still under construction but will very soon become more official.
The goal is to make an interactive version of already existing mountain hiking maps (on paper), for both PC and Android.
Hiking pathes are represented by polylines, and places by billboard planes.

Some technical features :
  • advanced billboard system (rectangular billboards for better picking, billboards have always the same size on the screen whatever their position, ...)
  • advanced blitting GUI (interaction with blitting elements, blitting drag with mouse / touch, buttons magnification, menu animations, blitting tooltips, ... )
  • fast vertical projection on map (using a kind of simple polygon research)
  • custom shader : add color on map depending on the altitude, and display altitude iso lines
  • high resolution texture (4096x4096) available even for android
  • camera : orbit camera system, camera smooth animation, the zoom with mouse wheel focuses on the point under cursor, compass-like camera rotation using android sensors, ...

Deployement :

I know there is nothing really technically special or complex, but just in case someone would like to know some details, feel free to ask.

JPCT was the perfect tool for me because I needed a light, simple, permormant and portable 3D framework.
So thanks a lot JPCT community and especially EgonOlsen for the very useful help !


Here is a part of the existing paper version :



And here is how the app looks like basically for now :




Custom shader :



Blitting menu opening animation :



8
Bugs / Java 7u45 + LWJGL Applet = Access denied org.lwjgl.util.Debug
« on: October 20, 2013, 10:22:36 pm »
Hi,

After updating java to 7u45, I cannot launch my Applet anymore.
It seems to come from a jar signature problem, as discussed in the LWJGL forum : http://lwjgl.org/forum/index.php/topic,5206.0.html
The solution suggested by Pignic sounds a little bit tricky, does anyone have another idea ?

Here is what I get when I launch my applet using java 7u45 :

Code: [Select]
Loading Texture...from InputStream
Software renderer disposed
Using LWJGL's AWTGLCanvas
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.lwjgl.util.applet.AppletLoader$4.getPermissions(AppletLoader.java:1206)
at java.security.SecureClassLoader.getProtectionDomain(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.threed.jpct.GLHelper.findMode(GLHelper.java:67)
at com.threed.jpct.AWTGLRenderer.init(AWTGLRenderer.java:59)
at com.threed.jpct.FrameBuffer.enableRenderer(FrameBuffer.java:1134)
at com.threed.jpct.FrameBuffer.enableGLCanvasRenderer(FrameBuffer.java:723)
at com.faceausud.tm3d.TopoMapApplet.init(TopoMapApplet.java:53)
at com.faceausud.neouvielle.NeouvielleApplet.access$0(NeouvielleApplet.java:1)
at com.faceausud.neouvielle.NeouvielleApplet$MainPanel$1$1.run(NeouvielleApplet.java:74)
Caused by: java.lang.NullPointerException
at sun.plugin2.applet.Plugin2ClassLoader.loadAllowedCodebases(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.getPermissions(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getPermissions(Unknown Source)
... 22 more
Exception in thread "Thread-18" java.lang.ExceptionInInitializerError
at org.lwjgl.Sys.createImplementation(Sys.java:124)
at org.lwjgl.Sys.<clinit>(Sys.java:111)
at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
at com.threed.jpct.GLHelper.findMode(GLHelper.java:67)
at com.threed.jpct.AWTGLRenderer.init(AWTGLRenderer.java:59)
at com.threed.jpct.FrameBuffer.enableRenderer(FrameBuffer.java:1134)
at com.threed.jpct.FrameBuffer.enableGLCanvasRenderer(FrameBuffer.java:723)
at com.faceausud.tm3d.TopoMapApplet.init(TopoMapApplet.java:53)
at com.faceausud.neouvielle.NeouvielleApplet.access$0(NeouvielleApplet.java:1)
at com.faceausud.neouvielle.NeouvielleApplet$MainPanel$1$1.run(NeouvielleApplet.java:74)
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "org.lwjgl.util.Debug" "read")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at java.lang.Boolean.getBoolean(Unknown Source)
at org.lwjgl.LWJGLUtil$4.run(LWJGLUtil.java:454)
at org.lwjgl.LWJGLUtil$4.run(LWJGLUtil.java:452)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.LWJGLUtil.getPrivilegedBoolean(LWJGLUtil.java:452)
at org.lwjgl.LWJGLUtil.<clinit>(LWJGLUtil.java:265)
... 10 more


I agree this is more a LWJGL issue than a JPCT bug, but my LWJGL forum account is still awaiting admin approval...

Thanks in advance guys !

9
Support / Transparent plane and Picking
« on: August 13, 2013, 12:01:19 pm »
Hi,


After my Transparent plane and Polyline overlap problem, I'm trying to pick my transparent billboards.
Picking itself seems to work well on billboards, but my concern is once more about transparency. When I pick a plane on a transparent area of its texture, it is considered as picked anyway.
This behaviour was expectable and is pretty logical, but I would need my planes not to be picked on their transparent areas.

Do you think there is a way to do it using jPCT picking methods, or I'll rather have to implement it from scratch by myself ? If so, how to check the right picked color of an object in order to check if it is completely transparent ?


Thanks in advance, regards,


Sylvain

10
Support / Transparent plane and Polyline overlap
« on: July 31, 2013, 11:45:06 am »
Hi,


I'm very new with jPCT and this is my first post.
So first congratulations for this great framework, easy to use even for a person not familiar at all with opengl like me, I really appreciate !

I'm planning to develop a kind of "virtual hiking guide" (for a french mountain), showing pathes with polylines and interest points (like mountain huts, lake names, ...) using plane billboards.
It works great and even an old android phone with sdk 2.3.3 can handle my 20000 polygons terrain, which is awesome. To be honest I've tried first another android opengl framework but it couldn't take that amount of polygons. JPCT seems the most performant one !

Anyway, the point is I have a transparency problem with my planes. When a polyline is behind a billboard plane, it is displayed as if it was "in front" of the plane.
I gess the problem comes from my plane transparency, which I have set this way (I need alpha channel) :

Code: [Select]
Object3D plane = Primitives.getPlane(1, size);
if(TextureManager.getInstance().containsTexture(textureName) == false)
TextureManager.getInstance().addTexture(textureName, new Texture(bitmap, true));
plane.setTexture(textureName);
plane.setBillboarding(true);
plane.setTransparency(100);

Note that I also scale the planse according to their distance to camera to make them look always at the same size on the screen, but I don't think it has a link with the issue.

And here is how I create my polylines :

Code: [Select]
Polyline pathLine = new Polyline(pointsArray, color);
pathLine.setWidth(8f);
world.addPolyline(pathLine);

Thanks in advance, and tell me if you need a screenshot, I don't know if what I'm saying is clear, my native language is french.

Pages: [1]