12 October 2016 15:04

Hi there:

I've been working in a project which implies really big scenes, I'm trying to make kind of a space voyage game and I'm using the Gliese Stars Database to create the stars programatically in blender with Python which is great and in a couple of minutes you have the 1500+ stars in the scene. If you do it treating the coordinates units as meters it works fine and all the stars appear correctly in the exported scene and you can fly by and everything, but…

If you increase the distance by multiplying the distance you find one pretty bad problem I didn't have notice of. Indeed I'm not quite sure if the problem is what I think it is. I think it is about the precision of the calculations when you deal with big numbers. The thing is: as the 'space ship' is a cabin wich I attach the camera to by a semi stiff constraint of the camera to an empty that is at the same time a child of the rigid body which is the hull of the ship, when you progresively go further in space the constraint starts to behave in strange ways, in fact it ends up losing completely the position and no longer works properly, even going out of the cabin and viewing the ship from outside.

Then I found this page in the Blender documentation which explains that as we are using float 32 numbers the calculation with big numbers loses precision as we get further away from the origin, a thing a have heard of but never suffered as I hadn't work with so big distances.

Googling a little I found that this is not only a Blender problem but a problem with all the game engines and 3d software and hardware that are using these mumbers in it's core (which is pretty astonishing, I hope my bank to use double precision, hehe…)

Aside from that I'm still checking if this is in fact the case cause I'm using blender parenting and blend4web parenting at the same time and it could be that using only one type it works ok.

I tried to scale the scene too. In the blender documentation says that if you don't want so much precision in sculpting et al and scale the blender units to be 10 meters instead of 1 meter you get better calculations at big distances. I tried it, and it seems to work better, you go further away and the constraints keep stable.

But I found another problem the character don't seem to get the rescaling well and although the object itself gets scaled the physic body is still the same size and the body floats one meter above the ground

Is there any workaround to this problem? I'm still working on it and maybe I can adapt the object ok in the javascript using b4w api. It appears to be a hard problem. I mention it here because it is an issue that is pretty interesting all that float 32 thing…

Well, if you have any idea that could work it will be welcome, I'll keep on it and update this post as I go through it.

Cheers.

I've been working in a project which implies really big scenes, I'm trying to make kind of a space voyage game and I'm using the Gliese Stars Database to create the stars programatically in blender with Python which is great and in a couple of minutes you have the 1500+ stars in the scene. If you do it treating the coordinates units as meters it works fine and all the stars appear correctly in the exported scene and you can fly by and everything, but…

If you increase the distance by multiplying the distance you find one pretty bad problem I didn't have notice of. Indeed I'm not quite sure if the problem is what I think it is. I think it is about the precision of the calculations when you deal with big numbers. The thing is: as the 'space ship' is a cabin wich I attach the camera to by a semi stiff constraint of the camera to an empty that is at the same time a child of the rigid body which is the hull of the ship, when you progresively go further in space the constraint starts to behave in strange ways, in fact it ends up losing completely the position and no longer works properly, even going out of the cabin and viewing the ship from outside.

Then I found this page in the Blender documentation which explains that as we are using float 32 numbers the calculation with big numbers loses precision as we get further away from the origin, a thing a have heard of but never suffered as I hadn't work with so big distances.

Googling a little I found that this is not only a Blender problem but a problem with all the game engines and 3d software and hardware that are using these mumbers in it's core (which is pretty astonishing, I hope my bank to use double precision, hehe…)

Aside from that I'm still checking if this is in fact the case cause I'm using blender parenting and blend4web parenting at the same time and it could be that using only one type it works ok.

I tried to scale the scene too. In the blender documentation says that if you don't want so much precision in sculpting et al and scale the blender units to be 10 meters instead of 1 meter you get better calculations at big distances. I tried it, and it seems to work better, you go further away and the constraints keep stable.

But I found another problem the character don't seem to get the rescaling well and although the object itself gets scaled the physic body is still the same size and the body floats one meter above the ground

Is there any workaround to this problem? I'm still working on it and maybe I can adapt the object ok in the javascript using b4w api. It appears to be a hard problem. I mention it here because it is an issue that is pretty interesting all that float 32 thing…

Well, if you have any idea that could work it will be welcome, I'll keep on it and update this post as I go through it.

Cheers.