Web Pages in Game Engine

A very quick question;

Is it possible to render live web pages or HTML in the game engine?

I’m sure I have seen a YouTube video showing something like this, but I can’t find it again. :confused:

I do not think so.
I do not know what use it could have in a game engine.

It would be cool though if a blend. could be saved as an applet for a web page. Maybe through java or python. Too bad the web plugin died…

I have a friend on here who can chat on a live chat thing with blender, he can open it it will display the webpage in a blender view, he had to make each thing in blender though, like the webpage, and then he could chat, I don’t know much about it though.

I think it may be possible to write basic HTML parser and renderer in blender with Python. Once i saw a web browser made in python(dont remember the name) and I think that web browser could be made inside blender with Rasterizer and mathutils modules… maybe some external libraries would be needed.

One I have made a script that rendered a text file from my server and I think it could render html file too. But I would have to make some modifications, like do /n when <br /> tag appears in text

like the webpage, and then he could chat, I don’t know much about it though.

I believe, Oldjim is working on such a project, we have one here too…
I really don’t see the need to have a html page run on the GE except if you need to run a VR world. In the last case, the VR world runs on the net, not the other way around.
Web pages are graphically designed, but I doubt the BGE would run HTML (it’s a game engine?!). So far, the best 3D web authoring tool I know is Demicron, and there’s a free version… The real deal is quite expensive.

I came across an interesting study of someone using python to access HTML pages online and extract the information he wanted. Perhaps there’s a way to take the information gathered from an HTML in python, which then could interprete it and pass it on to the game engine. So far I think he only managed to get text working, so you could take that text using it as a variable value to render it on a plane in the GE.

Here’s the article: http://www.boddie.org.uk/python/HTML.html

Don’t know how useful it will be, but it might give some ideas/pointers.

It is possible to get data from web pages from the Internet into BGE.


import urllib

try:
    x = urllib.urlopen("http://www.btags.org/test.html")
    print str(x.read())
    print ("connection to the server was succesfull")
except:
    print "connection failed, check your connection or contact server administrator"

blender version: 2.49b

I will try to find a way how to recognise html tags in BGE later… maybe css files too :slight_smile:

Imagine how cool would id be to play GTA VII… you will do a mission, check facebook in the ingame browser and do another mission
edit: output is in console

I believe there are python modules that handle HTML tags you could import the module into BGE scripts and access their functions (there was htmllib but that’s been depreciated now). Not sure about CSS.

well, some unclosed tags can be parsed with core python only


print str(x.read()).replace("&lt;br /&gt;", "
")

that was just a raw example. other tags like

&lt;html&gt;

could be replaced with just “”.

edit: i modified my test.html file, you can try it.