Erratic Sprite Behavior

Blitz3D Forums/Blitz3D Programming/Erratic Sprite Behavior

stayne(Posted 2007) [#1]
My hud sprites are fine (Sprite Candy mostly and a bit of Compass code from the archives) at 0,0,0 but when I venture off past 3500 or so any any direction everything starts to shake a little... seems to be around one pixel or so to the left and right.

Any ideas? I'm updated to v1.99.


syntax(Posted 2007) [#2]
it has to do with the camera clipping. you probably used the command CameraRange to make the close range less. when you do this the math or something another starts to mess up when the camera gets far away from 0,0,0. If you did make the CameraRange close value less than 1 try moving it a little closer to 1 and seeing if you still have the problem, or at least as much of the problem.


stayne(Posted 2007) [#3]
Thanks syntax, but the camera range is 1.0 at the moment.


syntax(Posted 2007) [#4]
eh... try 2 maybe. if that doesnt work then i dont have a clue. the geometry should also begin to shake when you get that far out if its the camera range. does it?


stayne(Posted 2007) [#5]
Negative, just the HUD. I'll try 2.


Gabriel(Posted 2007) [#6]
If you need to have large worlds and high accuracy, the best way to do it is to keep your camera/player object at 0,0,0 and move the world around it. It's a little hard to think in those terms at first, but once you get your head around it, it's very easy to implement.

This way - although there is nothing you can do to entirely solve these jitters, they're only happening so far away that you can't see them.


stayne(Posted 2007) [#7]
Thanks Gabriel and you're right, it's going to take a while for me to solve that one. I have clouds moving, sun/moon rotation, NPC models running around, etc. My head already hurts :).


syntax(Posted 2007) [#8]
it might be easier to use the system you have and when the player gets 1000 un. away from 0,0,0 pick everything in the world up and move it negative what the player's X,Y,Z is and place the player at 0,0,0 all in one frame.

Or...

you could scale everything you have in your world down by .1 and also scale all the moveentity variables by .1 and more shrink your world to fit in the 3500 un box of non-shakeiness.

just a few more thoughts.


GfK(Posted 2007) [#9]
I used to get this 'sprite shaking' effect too - found out that it happens when you have sprited/quads too close to the camera.

Solution is to move them away from the camera.


stayne(Posted 2007) [#10]
Thanks GfK, how far from the camera is a good start?


Dreamora(Posted 2007) [#11]
further than 0.5 and not further than 2000


stayne(Posted 2007) [#12]
I tried it with no luck. I also tried creating a separate camera for the hud, same results. I would love to scale everything down but I'm using Terra Ed and well... that would take longer to set up than I care to mention.

Thanks for the ideas everyone.


mindstorms(Posted 2007) [#13]
All you would have to do to scale everything down is to reparent them to a pivot and then scale the pivot...and the move commands


lo-tekk(Posted 2007) [#14]
I had exactly the same probs 2 years ago. Take a look at the SpriteCandy Forum:

http://playerfactory.proboards25.com/index.cgi?board=spritecandy&action=display&thread=1121117508