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.

Geek Culture / render a 3D image on web page

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Dec 2013 17:06
Calling the web gurus. Is there any way to generate a 3D scene on a web server, and deliver a 2D rendering of it?

For example, using PHP I would create a scene (on the server) with an obj file and a couple of planes. then I take 3 "screenshots" and deliver these to the web page.

My current web package is Linux based but I could use a Windows server if necessary. What I don't want to do is send my proprietary 3D Obj model to the end user.

Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 16th Dec 2013 17:17
You couldn't pre-render the scene and just upload the images to use?

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Dec 2013 17:37
The catch is, the user needs to be able to upload the model texture. Imagine a room where you choose the picture to put on the wall before it is rendered.

I haven't found an answer yet. There are many partially-completed projects out there like Pear PHP, but nothing solid. I'm wondering if there's an affordable Flash option.

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 16th Dec 2013 18:33 Edited at: 16th Dec 2013 18:34
I've not heard of any systems to do this - or any way of doing it on a web server, but what is sounds like you're trying to do is what many MMORPG sites do, I can view a picture of my character model completely static, for example:




So it can be done.

Only way I think you might be able to do it, is I suppose you'd need to write a program on the server to handle this. That'll take input from the client, apply it to a model on the server, take a picture and save it to a directory on the server that can be accessed by the client. But I can imagine it getting resource intensive. But this is purely me being speculative.

If you're looking for an affordable clientside option, have you thought about Unity 3D? Sadly they've dropped flash support, but you've still got their web player.

Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 16th Dec 2013 18:52
I was going to suggest Unity 3D as well, their web player has a pretty big install base now (and is really quick to install anyway).

There's quite a few Unity devs on here these days as well (myself and Seppuku included) who might be able to help out.

The Next
Web Engineer
16
Years of Service
User Offline
Joined: 3rd Dec 2007
Location: United Kingdom
Posted: 16th Dec 2013 19:34
This is totally possible you can write for example a JAVA/VS program on the server that takes some console parameters for the texture file you wish to use and where the user uploaded the texture.

You would have a PHP script call this program and give it the right parameters via the PHP shell commands. When it executes screen renders will be taken and saved to a directory accessible by PHP.

Then simply show them on the page.

This is all theoretical however and much easier ways of doing this can be used. Many of those ways no server side processing is required for example a flash applet/java applet can do this far easier and is all client side so you won't need a powerful server to do the rendering.

Please keep in mind most servers do not have a graphics renderer or one that is powerful enough to do this at any scale beyond just a few users. Also it is important to remember that PHP is server side and won't be able to produce a real time 3d application like a flash applet or java applet would.

On another note you could do all of this in HTML5, but it is a lot of work and the technology required is not in most browsers and the ones it is are touch and go.

Windows 7 Pro, Intel i7 3.8 GHz, 16GB DDR3, NVIDIA GTX 780 4GB Superclocked

View the beta TGC forum progress at the url below View beta forum
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 16th Dec 2013 21:08
http://en.wikipedia.org/wiki/YafaRay
http://en.wikipedia.org/wiki/POV-Ray

There are standalone renderers that will render a scene to an image. Probably even blender and other 3d modellers could do the same.

However that's not the sort of software you are going to find installed on a shared host.

By way of demonstration, he emitted a batlike squeak that was indeed bothersome.
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 17th Dec 2013 02:28 Edited at: 17th Dec 2013 02:29
http://php.net/function.exec

That should help. Hopefully you're using a VPS and not a shared host cuz this isn't 1999

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Dec 2013 04:33
Can you use WebGL?

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 19th Dec 2013 15:52
+1 for WebGL. It seems pretty solid, Three.JS works very well for me.


They see me coding, they hating. http://indi-indicium.blogspot.co.uk/
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 19th Dec 2013 16:45
How about vrml?

_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 19th Dec 2013 18:24 Edited at: 19th Dec 2013 18:25
If you want to render 3D in the browser without the need for any plugins, I would strongly recommend Three.js (a JavaScript WebGL wrapper). It also supports importing .obj model files.
But I don't get what all the server-side talk here is about, so I may have missed the point...

Visit my blog: sebastianpauli.tumblr.com
Jeff032
16
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 19th Dec 2013 22:10
Quote: "But I don't get what all the server-side talk here is about, so I may have missed the point..."


Quote: "What I don't want to do is send my proprietary 3D Obj model to the end user."


That would rule out WebGL.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Dec 2013 22:14
Thanks Jeff032, that's the issue. I need to create 2D images of a 3D scene, server side, and deliver the 2D renders.

Why do I need to generate the scene each time? Because the user supplies the texture.

I'm thinking, as mentioned by the_winch earlier, that a shared server isn't going to have what I need to accomplish this.

bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 19th Dec 2013 22:26
no, but a VPS will. Check out gandi.net, prgmr.com, or digitalocean.com.

I would be willing to integrate this into a website for you with payment on results if you like.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st Dec 2013 11:50
Thanks for the offer BitJericho.

As a first step, I'm going to develop the concept in AppGameKit as a standalone app. That way I can visualise it, see if it is achievable, and also be able to present the idea. If it's a workable model I'll come back to you about making it an online app.

Login to post a reply

Server time is: 2024-05-11 11:28:04
Your offset time is: 2024-05-11 11:28:04