If i want to place QWebKit on top of OpenGL what is the best way to do it ?



  • does this example :
    http://labs.qt.nokia.com/2008/06/27/accelerate-your-widgets-with-opengl/
    from 2008 is valid or there is better ways now in 2011?





  • hi
    yes , i download you model viewer modified demo
    do you have any source code to this browser code??



  • I don't understand.

    Line 70 - 74 of openglscene.cpp

    @
    QWebView *webView = new QWebView();
    webView->load(QUrl("http://developer.qt.nokia.com/forums/viewthread/6151/"));

    QWidget *instructions = createDialog(tr("Web Browser"));
    instructions->layout()->addWidget(webView);
    

    @

    Then just go to http://doc.qt.nokia.com/4.7/qtwebkit.html
    or in particular http://doc.qt.nokia.com/4.7/qwebview.html

    You will find all of the api's to make the web browser of your dreams ;)



  • i guess your code that i was download is not updated with browser example



  • my mistake i did't download your link..
    wow performance is really crap ... hope that Qt will fix that in the next versions



  • No problem... lol Probably why you don't see alot of 3D Qt Web Browsers out there.



  • If your feeling adventures there is also Berkelium it's made to render to an OpenGL or DirectX texture.

    Berkelium is a BSD licensed library that provides off-screen browser rendering via Google's open source Chromium web browser.

    It takes advantage of Chromium's multiprocess rendering to isolate browsers from each other and can render to any buffer in memory. The user of the library can inject input and javascript code into web pages to control them, as well as listen for events generated by the page such as navigation events, load sequence events and paint events. Berkelium provides a small API for embedding a fully functional browser into any application.

    http://berkelium.org/

    Source is here.
    https://github.com/sirikata/berkelium

    Binary is here.
    https://github.com/sirikata/berkelium/downloads



  • wow this is great stuff!



  • Being that you posted this in the Game Development forum, might I make a suggestion for a game development framework.

    Ogre3D
    http://www.ogre3d.org/

    Ogre3D/Qt4Widget
    http://zester.googlecode.com/files/QtCreatorOgre2.zip
    !http://i52.tinypic.com/vxj0qf.png!

    Ogre3D Example
    http://zester.googlecode.com/files/Ogre3D.zip
    @
    // g++ main.cpp -o main pkg-config --libs --cflags OGRE OIS

    #include <Ogre.h>
    #include <OgreFrameListener.h>
    #include <iostream>

    using namespace Ogre;

    //
    class MyFrameListener : public FrameListener {
    public:
    bool frameStarted (const FrameEvent &evt);
    bool frameEnded (const FrameEvent &evt);
    bool frameRenderingQueued (const FrameEvent &evt);
    };

    //
    bool MyFrameListener::frameStarted(const FrameEvent &evt) {
    std::cout << "Frame Started" << std::endl;
    return true;
    }

    //
    bool MyFrameListener::frameEnded(const FrameEvent &evt) {
    std::cout << "Frame Ended" << std::endl;
    return true;
    }

    //
    bool MyFrameListener::frameRenderingQueued(const FrameEvent &evt) {
    std::cout << "Frame Queued" << std::endl;
    return true;
    }

    int main(void)
    {
    // Create an instance of the OGRE Root Class
    Root* root = new Root;

    // Configures the application
    if (!root->restoreConfig())
    root->showConfigDialog();
    root->saveConfig();

    // Create a render window
    RenderWindow* window = root->initialise(true, "Tutorial 1");

    // Create a new scene manager.
    SceneManager* sceneManager = root->createSceneManager(ST_GENERIC);
    sceneManager->setAmbientLight(Ogre::ColourValue(0.0, 0.0, 0.0));

    // Create a new camera
    Camera* camera = sceneManager->createCamera("Camera");
    camera->setPosition(Ogre::Vector3(0,0,15));
    camera->lookAt(Ogre::Vector3(0,0,0));
    camera->setNearClipDistance(5);

    // Add our model to our resources and index it
    

    ResourceGroupManager::getSingleton().addResourceLocation("Media/packs/Sinbad.zip", "Zip");
    ResourceGroupManager::getSingleton().addResourceLocation("Media/models/", "FileSystem");
    ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

    //
    Light* light1 = sceneManager->createLight("Light1");
    light1->setType(Ogre::Light::LT_POINT);
    // Set Light Color
    light1->setDiffuseColour(1.0f, 1.0f, 1.0f);
    // Set Light Reflective Color
    light1->setSpecularColour(1.0f, 0.0f, 0.0f);
    // Set Light (Range, Brightness, Fade Speed, Rapid Fade Speed)
    light1->setAttenuation(10, 0.5, 0.045, 0.0);

    //
    Entity* lightEnt = sceneManager->createEntity("LightEntity", "sphere.mesh");
    SceneNode* lightNode = sceneManager->createSceneNode("LightNode");
    lightNode->attachObject(lightEnt);
    lightNode->attachObject(light1);
    lightNode->setScale(0.01f, 0.01f, 0.01f);
    lightNode->setPosition(0, 4, 10);

    sceneManager->getRootSceneNode()->addChild(lightNode);

    // Using the camera create a viewport and set the background color to black
    Viewport* viewport = window->addViewport(camera);
    viewport->setBackgroundColour(Ogre::ColourValue(0.0,0.0,0.0));

    // Use the viewport to set the aspect ratio of the camera
    camera->setAspectRatio(Real(viewport->getActualWidth()) /
    Real(viewport->getActualHeight()));

    // Create an instance of our model and add it to the scene
    Entity* ent = sceneManager->createEntity("Sinbad.mesh");
    SceneNode* entNode = sceneManager->createSceneNode("Character");
    entNode->attachObject(ent);
    sceneManager->getRootSceneNode()->addChild(entNode);
    entNode->setPosition(0,0,0);

    // Create an instance of the MyFrameListener Class and add it to the root object
    MyFrameListener* myListener = new MyFrameListener();
    root->addFrameListener(myListener);

    // Tell root to start rendering
    root->startRendering();

    // Cleanup
    delete myListener;
    delete root;

    return 0;
    }
    @

    For water there is Hydrax
    http://www.ogre3d.org/tikiwiki/Hydrax
    !http://www.ogre3d.org/tikiwiki/img/wiki_up/Hydrax.jpg!

    For Sky and Weather Effects there is SkyX
    http://www.ogre3d.org/tikiwiki/SkyX
    Note: It,s used in the Hydrax screenshot above.

    There actually really easy to use.

    There is also.....

    Cutexture: A Framework for Qt User Interfaces in Ogre3D
    http://advancingusability.wordpress.com/2010/11/09/cutexture-a-framework-for-qt-user-interfaces-in-ogre3d/
    !http://i56.tinypic.com/b6xb83.png!

    Note: Berkelium can be used directly with Ogre3D and Qt



  • If your interested in doing 3D (Model, Texturing, Animation, Compositing, .....) with Blender http://www.blender.org/ I am a Blender Master http://developer.qt.nokia.com/forums/viewthread/6717

    Just click on my profile and send me an e-mail I am sure I can get you going in the right direction.

    :)


  • Moderators

    Impressive work zester!



  • Great stuff , thanks!
    Hi
    are you doing planing to do the game in Qt3d?



  • bq. Hi are you doing planing to do the game in Qt3d?

    Qt3d was a consideration. After trying it out for sometime I came to the conclusion that for my
    "No Rest For The Wicked" project it wasn't a very good fit. Qt3d AFAIK has issues with lights and doesn't
    have bone animation support. Both of those issues are deal breakers.

    As of right now for a Highpoly game OGRE3D is the best fit and for a Lowpoly Browser Based
    game Three.js is the best fit.

    Why? What did you have in mind?



  • I have in my mind to make interactive applications for kids , not 3d games in my opinion its very full market of indie game makers and wannabe game makers very hard to put something good .
    its fun its great programming challenge but with no ROI for your work.
    now im looking for platform , Qt is winner for me.



  • Qt3d would be a good fit for interactive applications for kids.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.