Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapping texture to 3D objects in a batch process on the server

we have the following use case:

  1. the user uploads her picture on a web server
  2. at a later time - on the server - the picture(s) are mapped on predefined 3D objects and stored as normal images (png, jpeg, ...). For now just the front-view. The files will be deleted once the session ends.
  3. show them in normal img tags to the user

In order to support this, i was thinking of the following process:

a. the 3d models are created offline and uploaded to the server
b. in real time, the texture mapping is done on the server
c. the generated view of the 3D model is saved to a temporary file
d. the file is displayed in a img tag

So now to the questions:

what are your suggestions about the tools that would support this kind of process? The OS on which they run is not important. The steps b. and c. should be quite fast.

So the requirements for theses tools are:
for the 3D modeler:
- open source
- easy to use
- save the model in a format readable by the library used in the next steps

for the graphical library:
- open source
- easy to use
- easy on resources (well as much as a graphics intensive application can be :) )
- read the files generated by the modeler
- apply textures
- save a view of the generate object + texture to a normal file to be displayed in a browser.

Thanks.

like image 728
Memical Avatar asked Oct 14 '22 10:10

Memical


2 Answers

(it seems i cannot add a comment to the question above - thus sending this as an answer)

all you suggestions are great and we had great fun trying them out.

however pretty soon it became clear that we cannot apply them on the server-side since the server does not have a GPU.

now there are 2 options arround that:

  • use something like a ReferenceGraphicsDeviceManager - which does not need a GPU. The dowside here is that it is really slow.
  • buy a graphic card for the server. My worry here is scalability. Do any of you have any experience here: is GPU suitable for handling parallel requests comming from the web server?

Thanks.

like image 76
memical Avatar answered Oct 18 '22 23:10

memical


what are your suggestions about the tools that would support this kind of process? The OS on which they run is not important. The steps b. and c. should be quite fast.

There are a lot of 3D modelers out there, I suggest you look at Blender, but here there is a list (with screenshots) of 25 apps out there

Here are some tutorials explaining how to model for XNA with Blender:

http://www.stromcode.com/2008/03/10/modelling-for-xna-with-blender-part-i/ http://www.virtualrealm.com.au/blogs/getting-started-with-blender-3d-and-xna/

for the graphical library

I suggest you use XNA, it will save you time since it's c# and doesn't need a lot of effort to pick up and it's very quick because it uses the GPU. You will need to load a model from a file (you can make it import during runtime with a bit of effort) then load the texture and apply it to the model through the models' Effect.

Then you can generate the image you want to a file accessible by the website. Your users can then read the images.

like image 28
Ezz Avatar answered Oct 18 '22 22:10

Ezz