Winsock - Sending 3D Objects

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Winsock - Sending 3D Objects

Post by LunaRebirth »

Hello!!

I tried researching this topic literally all week, and couldn't find anything -- which was very degrading mentally.

So what I'm trying to accomplish won't be simple, if even possible at all. I know this.
I've a server and client. The server sends the client info on start-up.

Currently, when someone downloads my program; it has everything in it's files. The .objs, .b3ds, all images, etc. for Irrlicht to find.
But is there a way to send a .obj file to the client, without the client downloading it as an actual file?

For example:
The server has a file in its' directory named "Building1.obj"
Is there a way for the server to send the contents of Building1.obj to the client, and the client stores it and creates an IAnimatedMeshSceneNode out of it, without downloading Building1.obj into the client program directory?

Thanks in advance.:)
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Winsock - Sending 3D Objects

Post by LunaRebirth »

Or even renaming the Building1.obj to Building1.myExtension but still loading it as a .obj mesh?

My main reason for this topic is that I'm concerned someone has access to my material and can use them elsewhere when they're displayed as .obj's which can easily be accessed by nearly all 3D Modelling programs (such as Blender).
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Winsock - Sending 3D Objects

Post by mongoose7 »

You could encrypt it. Before loading you would decrypt it and then delete this version after reading it. But the unencrypted form would be in the filesystem for a short time, which would allow a dedicated hacker to gain access. It depends on the level of "attacks" that you want to prevent.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Winsock - Sending 3D Objects

Post by hendu »

Look up memoryfile in the docs, with that you can load images and models from RAM.

Though for OBJ, it cannot load the MTL file like that.
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Winsock - Sending 3D Objects

Post by LunaRebirth »

mongoose7 wrote:You could encrypt it. Before loading you would decrypt it and then delete this version after reading it. But the unencrypted form would be in the filesystem for a short time, which would allow a dedicated hacker to gain access. It depends on the level of "attacks" that you want to prevent.
Do you mean like, have the server send pieces of the file until the client receives it all, save the received stuff into a file (the object file), load the object from the file, then delete the object file?
hendu wrote:Look up memoryfile in the docs, with that you can load images and models from RAM.

Though for OBJ, it cannot load the MTL file like that.
Would this be memory consuming? Or is this a better option?

--------

I also thought about something that I'm not quite sure would work.
Didn't want to try without asking first. What if I made the server, rather than a console, also an Irrlicht program. Then have the server load an object and send the object?
Since I'm sending structures, couldn't I just put an IAnimatedMeshSceneNode into the struct and send it, the client receives it and then loads it?

Or would that not work as I'm imagining?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Winsock - Sending 3D Objects

Post by hendu »

Would this be memory consuming? Or is this a better option?
You need to store the data either in memory or disk. You said you wanted to avoid disk.

It does not matter whether you send the model data or the after-loading indices, vertices and animations.
danielmccarthy
Posts: 51
Joined: Fri May 30, 2014 12:55 am

Re: Winsock - Sending 3D Objects

Post by danielmccarthy »

I personally think it is a bad idea for you to send objects over the server to the client. It would make sense to just send objectIds from the server to the client and then have the client look up the objects location based on the object id.
kklouzal
Posts: 343
Joined: Sun Mar 28, 2010 8:14 pm
Location: USA - Arizona

Re: Winsock - Sending 3D Objects

Post by kklouzal »

You missed the point of the question, instead of bundling assets with the client application the server could just stream the assets to the client when they are needed.
Dream Big Or Go Home.
Help Me Help You.
Ruxify
Posts: 33
Joined: Tue Oct 16, 2012 12:37 am

Re: Winsock - Sending 3D Objects

Post by Ruxify »

Here's what I would do:

1. We're dealing with .obj files so in order to make the corresponding .mtl files to work (also include the texture files), I would put them all in a .zip file on the server.

2. Then I would have the server read the .zip file (IMPORTANT: Make sure it reads in binary mode) from the HD and then send the data to the client.

3. On the client side, put the data into an IReadFile (look up in the docs to find out how to make raw memory into an IReadFile).

4. Finally, add the IReadFile as a File Archive. This will add all the .obj, .mtl and texture files to the client file system. Then you can load them in with irrsmgr->getMesh("yourmodel.obj");
Post Reply