Freelance & command line ouput/scripting

Problems building or running the engine, queries about how to use features etc.
Post Reply
Ideas0014
Gnoblar
Posts: 6
Joined: Mon Mar 17, 2014 3:46 pm

Freelance & command line ouput/scripting

Post by Ideas0014 » Mon Mar 17, 2014 4:34 pm

Hello,

I'm hoping to get some advice here and potentially a solution to my issue. I have a website that is coded in php hosted on a dedicated linux platform. I want to be able to display flat images to my users from a 3d modelling engine when passed a texture to apply.

Firstly, will ogre be suitable for this task? From my reading, this seems the case, but I'm not an expert.

Secondly, is this a suitable place to find a freelance designer who would be able to create the models & scripts for the texture input/output when run from a command line on the server?

I'm happy to discuss the project in further detail if you need more information.

Thanks,
Jez
0 x

User avatar
areay
Bugbear
Posts: 819
Joined: Wed May 05, 2010 4:59 am
Location: Auckland, NZ

Re: Freelance & command line ouput/scripting

Post by areay » Tue Mar 18, 2014 10:24 am

Ideas0014 wrote: Firstly, will ogre be suitable for this task? From my reading, this seems the case, but I'm not an expert.
Yes, Ogre can apply textures to models. Of course you'd have to make sure the model was something that Ogre could use though, but it sounds like that can be handled as part of your second question...
Ideas0014 wrote: Secondly, is this a suitable place to find a freelance designer who would be able to create the models & scripts for the texture input/output when run from a command line on the server?
There is a recruitment section on this forum, you could ask there.


Here's one simple approach to your problem:
1. Recruit someone to create an Ogre application that takes command line arguments specifying what model to use, as well as the texture that the user will provide. You may also want it to take parameters like camera distance and orientation as well as the outputted filename of the screenshot that you want to present back to the user.
2. Make your PHP script copy in the user-supplied texture somewhere into the application's resource directory.
3. Then make your PHP script create a subprocess which starts the Ogre app in the background. The app's only job will be to startup, show the model with the texture for one frame, take a screenshot then quit. After the app quits there will be a screenshot somewhere that you can copy into your web docroot and you're done. The user is going to have to wait for a while for Ogre's whole startup/shutdown to complete so your main PHP script is going to have to poll the state of your Ogre sub-process.

I think your server will actually need to create a window to do this stuff, I don't know if Ogre can render without a proper rendersystem (ie. there's no 'NULL renderer' for Ogre3D) so if you're using some cloud/shared server to host your site it might not work. If you were expecting this feature to be used a lot, and you are worried about screenshot generation time, you could complicate the Ogre app by keeping it open all the time and getting PHP to send it commands via some sort of pipe/RPC/SHM channel and then get it to reload materials using the new textures etc.

Oh and here's another (mean-spirited) approach :)
1. Use HTML5 and WebGL, that's what it's there for :)

Anyway, hope that helps
0 x

Ideas0014
Gnoblar
Posts: 6
Joined: Mon Mar 17, 2014 3:46 pm

Re: Freelance & command line ouput/scripting

Post by Ideas0014 » Tue Mar 18, 2014 10:59 am

Thank you very much for your comprehensive reply.

I'll try to locate the recruitment section and take a further look around. I believe the textures could be parsed prior to the user interaction as we run several caching mechanisms on our website which will therefore not affect user performance.

WebGL is an interesting idea - perhaps in a couple more years ;-)
0 x

User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1669
Joined: Mon Jan 21, 2008 10:26 pm

Re: Freelance & command line ouput/scripting

Post by madmarx » Wed Mar 19, 2014 11:06 pm

Hi there,

Usually it is not recommanded to do rendering on a linux server like this with Ogre (this question comes back regularly on these forums). Ogre needs a windows and is developped with a "realtime rendering" ideal which means, it is made to use a graphic card. If you got a software mesa opengl renderer that might be ok, but otherwise, I doubt Ogre is the best tool for the job. What you need is just rendering not specially targeted to realtime, so a software renderer is probably more adapted to your need, doing the job without the window/opengl constraints. Also, depending on what you want to achieve as rendering result, the software renderer might be a better choice.
Also software rendering doesn't mean it is very slow : it depends on the scene.

2 little questions :
- do you need lighting (to percieve the 3d), or just texturing without perceiving any 3D ?
- do you need transparency (the models have parts which are not completely opaque, eg 50% opacity) ?

Best regards,

Pierre
0 x
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0

Post Reply