Search found 16 matches

by olaf
Wed 1. Apr 2009, 10:26
Forum: Programming Help
Topic: Two questions about picking
Replies: 6
Views: 1198

Thanks! I'm not sure I like the sampling idea too much, but since my geometries and scene graphs are very simple in the case I'm looking at, I might be able to write something up that intersects the geometry directly with the selected frustrum. What's a good way to compute the ray corresponding to t...
by olaf
Tue 24. Mar 2009, 14:56
Forum: Programming Help
Topic: Two questions about picking
Replies: 6
Views: 1198

Many thanks! I was not drawing spheres or tubes. Setting both POINT_RADIUS and SPHERE_RADIUS to sufficiently small values solved the problem.
by olaf
Tue 24. Mar 2009, 08:15
Forum: Programming Help
Topic: Two questions about picking
Replies: 6
Views: 1198

Two questions about picking

1) How can I change the sensitivity of picking? I've noticed that if I have two objects A and B with A in front of B, then sometimes A is picked even if the whole mouse pointer is clearly off A. What I'd like to do is tell the toolsystem to pick only objects within, say, 3 pixels of the current mous...
by olaf
Fri 27. Feb 2009, 07:24
Forum: Programming Help
Topic: Polygons and (non-tube) lines in JOGL
Replies: 11
Views: 2331

Thanks for the link.

So if I understand you correctly, the method I suggested has been tried, and didn't work?
by olaf
Thu 26. Feb 2009, 13:15
Forum: Programming Help
Topic: Polygons and (non-tube) lines in JOGL
Replies: 11
Views: 2331

I understand. The thing is, from the OpenGL documentation I found online I couldn't quite figure out whether dlDepthRange was applied before or after the perspective transformation. It seemed to make more sense to me to do it after, but that was just a guess. If you happened to have a link that expl...
by olaf
Thu 26. Feb 2009, 01:07
Forum: Advanced Development
Topic: Jreality with Jruby
Replies: 10
Views: 4669

Okay, problem identified. In the interactive example above, I had used a little script that populates the CLASSPATH and then calls the scala command, which is also a script. According to the documentation, it should accept -D arguments, but apparently it doesn't pass them to the JVM correctly. So I ...
by olaf
Wed 25. Feb 2009, 15:01
Forum: Advanced Development
Topic: Jreality with Jruby
Replies: 10
Views: 4669

Here's the transcript of an interactive session, with some slight editing to make it more readable. As you see somewhere in the middle, I didn't quite manage to get the jogl backend to work in this case, but I imagine that's only a matter of finding the right incantations. olaf@olaf-laptop:~/scratch...
by olaf
Wed 25. Feb 2009, 14:17
Forum: Advanced Development
Topic: Jreality with Jruby
Replies: 10
Views: 4669

Here's a quick translation of de.jreality.tutorial.too.DragEventTool01: package org.gavrog.scratch import java.awt.Color import scala.collection.mutable.ArrayBuffer import de.jreality.geometry.Primitives import de.jreality.scene.{Appearance, SceneGraphComponent} import de.jreality.scene.data.{Attrib...
by olaf
Wed 25. Feb 2009, 07:32
Forum: Advanced Development
Topic: Jreality with Jruby
Replies: 10
Views: 4669

I've used both Python and Ruby in larger projects, and they are pretty much in the same league. Personally, I prefer Python, but that's mostly a matter of taste. From memory, I found it a bit more difficult to interface with existing Java libraries from JRuby than from Jython. But that might have ch...
by olaf
Tue 24. Feb 2009, 07:51
Forum: Programming Help
Topic: Polygons and (non-tube) lines in JOGL
Replies: 11
Views: 2331

Hmm, if I understand correctly what glDepthRange does, wouldn't it be best to draw lines with glDepthRange(0.0d, 1.0d - OFFSET) and everything else with glDepthRange(OFFSET, 1.0d), where OFFSET is close to the depth buffer resolution?
by olaf
Mon 23. Feb 2009, 16:48
Forum: Programming Help
Topic: Polygons and (non-tube) lines in JOGL
Replies: 11
Views: 2331

Thank you so much! That helped a lot.

I suspected the DEPTH_FUDGE_FACTOR played a role, but didn't understand how to use it correctly.

Finding the best value does indeed seem tricky. If I come up with a good strategy, I'll let you know.
by olaf
Mon 23. Feb 2009, 03:26
Forum: Programming Help
Topic: Polygons and (non-tube) lines in JOGL
Replies: 11
Views: 2331

Polygons and (non-tube) lines in JOGL

Hi! I'm trying to render relatively large polygonal meshes (~40k quadrangles) with both faces and edges shown. Tubes do of course display fine, but at that complexity start to hurt performance. When I set 'TUBES_DRAW' to false, I see lines disappear behind incident polygons at certain angles. I know...
by olaf
Wed 18. Feb 2009, 15:22
Forum: Bugs
Topic: ToolSystem crash
Replies: 5
Views: 2084

I installed a MouseMotionListener on the viewing component that prints the mouse position on each drag. When the mouse pointer leaves the screen, drag events with position (0, 0) are generated. No idea why that would be a problem. Let me know if there's anything else I should try.
by olaf
Wed 18. Feb 2009, 02:42
Forum: Bugs
Topic: ToolSystem crash
Replies: 5
Views: 2084

Found a better fix

Okay, I poked the source code a bit more and found a better solution. The following modification to the end of RotateTool::perform() simply puts the rotation on hold until the mouse position leads to a correct transformation again: if (!fixOrigin) result.multiplyOnRight(center.getInverse()); if (Rn....
by olaf
Tue 17. Feb 2009, 14:58
Forum: Bugs
Topic: ToolSystem crash
Replies: 5
Views: 2084

Thanks! That was quick. With your fix, the toolsystem still gets into a strange state, but it doesn't crash anymore. After experimenting a bit, I came up with the following modification to RotateTool::perform(), which makes the object jump a bit when the mouse pointer leaves the screen, but at least...