Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Why?; functions set up kind of funny
Topic Started: Aug 21 2006, 09:03 PM (414 Views)
elmernite
Member
[ *  * ]
Why are the functions setup so that you have to declare variables (eg, file = 'model/tank.x') Then call the function (eg, LoadMesh();)

Why don't you have it setup so that you just do
Code:
 
LoadMesh('model/tank.x',texture,ect..);

rather than
Code:
 

file = 'model/tank.x'
texture = 'gfx/sky.jpg'
ect = 'ect'
LoadMesh();


It seams easier to understand and do the top one to me.
Plus, thats how all of the other 3d engines and scripts for Game Maker do it.
-Elmernite
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
elmernite
Aug 21 2006, 08:03 PM
Why are the functions setup so that you have to declare variables (eg, file = 'model/tank.x') Then call the function (eg, LoadMesh();)

Why don't you have it setup so that you just do
Code:
 
LoadMesh('model/tank.x',texture,ect..);

rather than
Code:
 

file = 'model/tank.x'
texture = 'gfx/sky.jpg'
ect = 'ect'
LoadMesh();


It seams easier to understand and do the top one to me.
Plus, thats how all of the other 3d engines and scripts for Game Maker do it.
-Elmernite

Probably because the current U3D engine isn't built that way. E.g LoadMesh() has no control over textures and so on. You are of course right that it would be alot easier if the engine was built that way. Maybe so easy that it would be difficult for Dr.Best to build the engine in that way. I'm not 100% sure so maybe Dr.Best can shed some more light on this when he reads it.
Offline Profile Quote Post Goto Top
 
elmernite
Member
[ *  * ]
I was just using Texture as an example. I do know that LoadMesh uses file.
So why not have it set up like.
Code:
 
LoadMesh('model/tank.x')

It shouldn't be that hard, I took a look at the script for loadmesh. Where it refers to the file variable he just needs to replace it with argument0.

-Elmernite
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
One of the basic principals of Ultimate 3D is that every object in the Ultimate 3D scene has to be represented by an object in Game Maker. This way the user can simply use variables to transform the object (which is done by the Step function). By taking the parameters for creating objects from member variables of the object the user gets forced to make one object for every 3D object in the scene. If all parameters would get passed as arguments of the script it would be easy to forget that. And then the user wouldn't have a possibility to change the properties of the object after creating it.

A solution to this problem would be returning the ID of the Ultimate 3D object in the script that creates it. But then the user had to pass all parameters for every function manually. In this case the Step script for models would suddenly have eleven arguments. And if one of them would be at the wrong place this would lead to very strange behaviour. Besides it's very probable that users of U3D would forget to call Destroy for every single object they have created. That can't happen when every U3D-object has it's own GM-object. At least it's less probable then.

If you prefer this system anyway you can modify the U3D scripts to realize it.
Offline Profile Quote Post Goto Top
 
elmernite
Member
[ *  * ]
Makes since. It's just I've been using the other two really good Gm 3d dll's (irrilch and Xtreme) and they both do it like I said. So it was a little bit new to do it this way. But yeah, I guess it makes it easier on you.
-Elmernite
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
Actually it would be easier for me to make it in the same way as GMI and Xtreme3D do it (not significantly but at least a bit). But IMHO it's really more user friendly in the way it is. For that reason I won't change it.
Offline Profile Quote Post Goto Top
 
elmernite
Member
[ *  * ]
Yeah, it's best to keep it that way then. Thats one of the biggest draws of this engine is it's user friendlyness.
-Elmernite
Offline Profile Quote Post Goto Top
 
Bami
Member Avatar
Guess the character, win a prize
[ *  *  *  *  * ]
Little bit of comment.

You know, function calls to DLLs are pretty damn slow, and now you are doing update thing every step for every object. Even if you implement a couple of if statements, its still slower then for example a "X_object_setPosition(obj,x,y,z);" function in Xtreme3D.

I used to make whole engines in GMI/X3D using only 4-5 objects. It's a lot faster, since objects just take time to update and such in GM.
Here are the thrill seekers, corrupt and immoral.
Posted Image
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Bami
Aug 24 2006, 01:33 PM
Little bit of comment.

You know, function calls to DLLs are pretty damn slow, and now you are doing update thing every step for every object. Even if you implement a couple of if statements, its still slower then for example a "X_object_setPosition(obj,x,y,z);" function in Xtreme3D.

I used to make whole engines in GMI/X3D using only 4-5 objects. It's a lot faster, since objects just take time to update and such in GM.

I have never used Xtreme3D, however I have played around some with the real Irrlicht and I was quite pleased with it eventhought it's OpenGL. But I doubt the performance of Xtreme3D is even close to what Ultimate3D offers. As far as I know, Xtreme3D is just a engine which focuses on cool 3D effects rather than performance and quality. Am I wrong? This is mostly opinions based on what I have seen and read and I don't wan't to be the one who hands out prejudices so please correct me if I am wrong.
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply