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.

DarkBASIC Discussion / Load an object, what is the difference

Author
Message
HomerS
17
Years of Service
User Offline
Joined: 8th Apr 2007
Location:
Posted: 9th Mar 2013 23:38
Hello,

Can someone tell me the difference between these three objects?

load object
load mesh
load static object

Especially, what is the difference between an object and a mesh? Can they do the same in the game/programm?

I don't understand that.

greetings.

Toedeledoki
Fluffy Rabbit
User Banned
Posted: 10th Mar 2013 02:37 Edited at: 10th Mar 2013 02:39
LOAD MESH just loads a mesh into memory so that you can use it in your program.

LOAD OBJECT both loads a mesh and places it in your game world for you to see. It doesn't give you access to the mesh data itself, but it does give you an object, which LOAD MESH does not.

If you want to use LOAD MESH and also have a 3D object as a result, you also need to use the command MAKE OBJECT, but if you just need a 3D object, you use LOAD OBJECT.

LOAD MESH is useful in cases where you want to do "mesh animation" or if you have multiple levels and you want to load everything in advance, or in cases where you have a lot of "dynamic" objects (more on this later) which use the same mesh, and you want it to load faster so you only call LOAD MESH once and call MAKE OBJECT many times on that mesh, which is already loaded. Accessing the hard drive is slow, but the MAKE OBJECT command is fast.

Think of it in terms of the mesh being the 3D model file and the object being what you actually see on the screen.

So, the quick and easy way to get a 3D object that you can use into your program is with LOAD OBJECT. LOAD MESH is for slightly more advanced purposes. It only loads the object into memory, not into the world. LOAD OBJECT does both.

LOAD STATIC OBJECTS is completely different. Basically, there is one big object called the "static object", which always exists in your game world. It doesn't do anything and never will do anything, it just sits there. When your game first starts, the static object is invisible. LOAD STATIC OBJECTS loads a special 3D model in a special format and adds it to the static object so you can see it. Supposedly, the static object renders faster than the regular "dynamic" objects.
HomerS
17
Years of Service
User Offline
Joined: 8th Apr 2007
Location:
Posted: 10th Mar 2013 10:19
aha,

A static object cant moved/animated in the game. Like a building?

And a mesh does not contain an animatie data, like an object does have?

Greetings.

Toedeledoki
Fluffy Rabbit
User Banned
Posted: 10th Mar 2013 12:02
Quote: "A static object cant moved/animated in the game. Like a building?"

A static object cannot be controlled independently of any other static objects, because there is only one static object. For all intents and purposes, THE static object is a backdrop. (It is arguable that there can be multiple static objects when using certain commands, but commands like LOAD STATIC OBJECTS ignore this functionality.)

There are no collisions either. Static objects also don't support transparent colors or ghosting, so grass is out of the question. Static objects are only really good for objects that don't matter and don't have anything to do with the game, like distant unreachable objects. I have never used static objects in any of the games I have posted here. Even objects that never move often still need to be "dynamic" regular objects.

Quote: "And a mesh does not contain an animatie data, like an object does have?"

Correct. A mesh is just the shape of an object. It represents the polygons, but not the animation or textures. Loading a mesh does not make an object. For that, you use either LOAD OBJECT or MAKE OBJECT. Objects are what you see, meshes are just data. That data can be turned into objects, but when you use LOAD MESH you are just given data, which has to be processed by other commands, like MAKE OBJECT.

Login to post a reply

Server time is: 2024-04-19 15:51:29
Your offset time is: 2024-04-19 15:51:29