Can this be done?

Blitz3D Forums/Blitz3D Programming/Can this be done?

Chroma(Posted 2007) [#1]
I heard you can store cameras and some other stuff in the .b3d model format. What Im wondering is can you store a camera and then load it so it will be loaded as a double? When you do an EntityParet if you get too far away from 0,0,0 it starts getting jittery. And Im assuming models are loaded as float because they dont get jittery at all.


bytecode77(Posted 2007) [#2]
some model formats from 3dsmax are supporting cameras, but if you take a look at the blitz 3d model format tutorial, you will notice, that a camera wont be loaded in blitz3d!
EntityParent entity1, entity2, Watch_This_Walue_!



Stevie G(Posted 2007) [#3]
You mean that the camera's x,y & z position will be stored as double precision floats?

If so it can't be done.

It's a result of floating point inaccuracy as you're implying. I'm guessing you're models are positioned reasonably close to the origin which would explain why they aren't suffering from this jittering.

The only way I know of to get around this is to move the world around the camera.

Stevie


IPete2(Posted 2007) [#4]
Are you talking about stuff parented to the camera such as gui elements jittering as you get further away from 0,0,0?

If so, you might want to check out Swifts post from about 3-4 years ago (no idea where it is) he came up with a work around, you use a second camera overlay for gui elements. I can't remember the the details just that it worked in this case.

IPete2.


Ricky Smith(Posted 2007) [#5]

I heard you can store cameras and some other stuff in the .b3d model format.


You can store whatever you like in the .b3d format. However when you use the native Blitx .b3d loader it only creates a pivot for each 'unrecognised' node it finds.
A simple approach is to store the values you require in the name of the node. You can then obtain this value by searching for the child node and parsing the entityname for it's properties.
e.g. you could have an entity name of "cam,x,y,z"
You would then know that this is a camera and its position.
You could also include rotation values as well.

Another way would be for you to create your own custom nodes with their own custom attributes rather than packing everything into the name.
I use this method to store Animation sequence information and joint type/limits for animated ragdolls.


sswift(Posted 2007) [#6]
I'm pretty sure you can reduce jitter by changing the scale you're using. So if you are using a scale of 1 unit = 1 meter, then change it to 0.1 unit = 1 meter, and see if the jitter is reduced or goes away.

By doing this you will lose some precision around the origin, but you probably have an excess of precision there to begin with.