View Full Version : View Jitter
09-21-2007, 11:40 AM
I've noticed a strange phenomenon when looking around data I've added into WW and wondered if anybody had any thoughts on what might be going wrong.
Currently I am overlaying GPS data in WW on my own custom layer. I am simply calling GL.glVertex3d(x,y,z) to draw my points in the scene.
When rendered and you zoom in and out the rendering is fine and smooth and the points stay exactly where they should.
However, when ever any kind of panning or tilting occurs with the view the points jitter around and sometimes end up getting rendered in a different place to where they were originally.
I thought initially it may be some kind of odd 64bit/32bit issue with the graphics card rendering.. however this can not be otherwise it would show up when you zoom in and out..
09-21-2007, 09:40 PM
I've already seen icons floating high above the ground in the wrong locations once... but i cant tell why or if it was related to your problem.
Could you post some screenshots to see how bad it is ?
If you're just using glVertex to draw your points then you're going to get jitter at close quarters. I won't go into the why's of that here, but this paper: http://planet-earth.org/cw05/FloatingOrigin.pdf will give you a description of the cause.
In WWJ we generate geometry in local coordinate systems relative to the geometry tiles/sectors. You'll notice that most of the wwj rendering methods have a pushReferenceCenter/popReferenceCenter pair surrounding the actual rendering. This eliminates the jitter problem. Take a look at some other layers if you want to see how to use it in your own layers. Eventually will fully document it.
09-22-2007, 09:57 AM
That certainly sounds like what my problem is.. when I get back to work on Monday I'll have a look at what you said about the tiles and see what I can do.
It's a bit tricky to take a screen shot of this.. something that really needs to be seen in an animation. The difference is probably about 10cms in the real world values.. which is obviously quite a small movement on the screen. If I manage to capture it in a screen shot I'll show you..
09-22-2007, 10:48 AM
It's a bit tricky to take a screen shot of this... The difference is probably about 10cms in the real world values.. which is obviously quite a small movement on the screen.
Fine, i understand - it is not what i've seen before. As Tag explains, this does indeed look like the infamous floating point jitter that has plagued the .net version for some time before it gets fixed with local reference centers, like it is in WWJ.
You'd need a video, not a picture. But don't spend time on it on our account. I'm pretty sure it's the problem I described, based on your description of it. It's a well-known problem in 3dg.
09-23-2007, 09:51 AM
Thanks for the answers.. however I have just one further question/clarification.
Because I have so many gps points to render and doubles take up a lot of space I decided to do the following:
1) Group points into clusters of 100,000.
2) Save first point as a double,double,double value.
3) Subtract this value from all the others.
4) Store other points as shorts (multiplied by 100 to keep 1cm accuracy)
Therefore when I draw the points I do a glTranslate to the first point. Then set my scaling by 100 before calling glVertexs.
Therefore I'm effectively doing a local origin/viewpoint for each "cluster" of points. Now however I see each cluster jitter in relation to others instead of the singular points themselves.
I presume this is still the same problem.. instead I need to find a way of representing all points referenced to the same offset somehow?
I'm not sure how I can achieve this as I group them in clusters based on area so that I can easily and quickly do view culling without having to check every single point..
09-23-2007, 12:12 PM
Of course by typing that I think I've answered my own question.
Currently I have say 40 Clusters of data and I do a translate in World coordinates to the first point in each cluster.. and then draw each point as an offset from the primary point.
What I should do of course is do ONE translation in World coordinates and then each cluster should be drawn hence forth as an offset from that original translation.. therefore moving in a local coordinate way..
Fingers crossed that works!
09-23-2007, 12:13 PM
Many thanks for your help :)
vBulletin® v3.7.1, Copyright ©2000-2013, Jelsoft Enterprises Ltd.