Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / When the 3D model is removed, it begins to gradually disappear.

Author
Message
GeomeTRY
User Offline
Joined: 11th Mar 2020
Location:
Posted: 11th Mar 2020 18:16
When the 3D model is removed, it begins to gradually disappear. (I am from Russia so there may be inaccuracies in the translation)

I exported the model from 3D blender, but when I move away from it, it starts to disappear. How do I fix this? Can this be solved by writing new commands?




I will be grateful for the solution of the problem

Raven
15
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 12th Mar 2020 01:45
What Scale do you use when creating or exporting with Blender?
I personally use Maya, which Defaults to a Centimetre Unit Scale... meaning that every 100 Units = 1 Metre

When working in other Game Engines, this might need changing., as for example Unreal Engine 4 (and this is a Legacy aspect) works in Inches.
So let's say I made a Vehicle (like a Car) in Maya, which was say 250 Units Long (2.5 Metres) ... well if I were to output this to Unreal Engine 4 "As Is", then it would end up being 20.8 Feet Long (6.4 Metres) so it would be a bit larger than intended.

Now when it comes to Dark BASIC Classic, Dark BASIC Professional or AppGameKit Standard/Studio., uses the same Centimetre Scale as Maya (or 3D Studio Max) by Default.
Where-as I believe that Blender uses Metres.

So, if you were to make a 10.0 x 10.0 x 10.0 Unit Box ... then this would load in to AppGameKit as a 1000 x 1000 x 1000 Box.
Strictly speaking this isn't an issue per se., because it doesn't actually matter to much what the Object Scale is provided you account for it within AGK/DBC/DBP.
To do this, you will need to change the Camera Field-of-View / Range.

This by Default is 1.0 Unit to 1000.0 Units, and anything closer or further than these values will simply not be Rendered.
If you want to switch to say a "Metres" variation of this, then doing something like:

SetCameraRange( 100.0, 100000.0 )

This will essentially have the same 1 Centimetre to 1 Kilometre Range that the Camera has by Default., but keep in mind you'll actually want this to be Adaptive to what you're Rendering... so keeping these Values "Simple" tends to be a good idea., especially if you plan to use Shaders.
As a note a reason why the Camera has a "Limitation" of this nature is for two reasons...
1 • Basic Performance Occlusion... that is to say, it's somewhat pointless rendering objects that are going to be < 1 Pixel on the Screen and frankly at a certain distance you'll never notice them anyway; so simply not rendering them saves on GPU Processing Power
2 • The Depth Buffer is based upon the Camera Near - Far Plane... now for AppGameKit the Depth Buffer is a 16bit Floating Point., which this is a little difficult to explain in simplified terms as it's a Weighted Precision Depth (i.e. the Near Plane is Weighted more Heavily, thus has better Precision than the Far Plane) but in as simplified terms as I can do, you realistically want these numbers to be as small as you can get them.

That is to say, ideally you want to have a difference no larger than 1024... if we could set a 24bit or 32bit Floating Point (which is more common for Desktop Depth Buffers)., then we could actually get away with MUCH Larger Camera Ranges without sacrificing Precision.
The Lower the Depth Buffer Precision, and the more Depth Fighting (2 Surfaces Flickering between each other to Occupy the same Space) occurs.
As AppGameKit is setup by Default, this doesn't really happen... or rather it's going to be exceptionally rare outside of extreme distances from the Camera... but if you change that even multiplying it by say 100., while Functionally nothing has changed, the Raw Numbers are Ranges that cause the Lower Precision Depth Buffer to simply not be able to Resolve with the same Resolution; thus can lead to Depth Fighting.

i.e. It's not a good idea to take such an approach.

Instead I'd recommend when you output your Blender Models via FBX (or whatever format you're using) to instead in the Export Options chose the Centimetre Output Scale.
I know that FBX does support this; while other Export Formats might not.

Another Option is to manually Scale when you import.
So say we KNOW that the Object is in Metres and we want Centimetres., well then SetObjectScalePermanent( ObjectID, 0.01, 0.01, 0.01 ) would have the same end result.
And this function differs from SetObjectScale( ) ... in that it will do this on the Stored Object Data, rather than as a Transformation on the Vertex Buffer prior to Rendering (which is only applicable for that single Render / Draw Pass)

I hope all of this helps.
If you're having any difficulty with some of the concepts here, I can probably put together some pictures to help.

Login to post a reply

Server time is: 2020-08-06 00:05:25
Your offset time is: 2020-08-06 00:05:25