Results 1 to 4 of 4

Thread: Show 3D model on 2D background

  1. #1
    Peasant
    Join Date
    Aug 2012
    Posts
    5

    Default Show 3D model on 2D background

    Hi all,
    I have 1 problem with show 3d model on 2D background. I used draw2DImage of Irrlicht but the background isn't show. I try add overlayentity and after that i added 3DS mode but overlayEntity is cover all screen and 3D model cannot display.

    Below code draw2DImage:
    Code:
    //mesh = pScene->getMesh( (GetBaseAppPath() + "game/sydney.md2").c_str());
    	video::IVideoDriver* driver = GetIrrlichtManager()->GetDriver();
    
    	video::ITexture* images = driver->getTexture( (GetBaseAppPath() + "game/background/bg.rttex").c_str());
            driver->makeColorKeyTexture(images, core::position2d<s32>(0,0));
    
        driver->draw2DImage(images, core::position2d<s32>(0,0),
                                    core::rect<s32>(0,0,1024,600), 0,
                                    video::SColor(255,255,255,255), true);
    
    	//mesh = pScene->getMesh( (GetBaseAppPath() + "game/squirrel.x").c_str());
    	mesh = pScene->getMesh( (GetBaseAppPath() + "game/model/1.3ds").c_str());
    
    	IAnimatedMeshSceneNode* node =pScene->addAnimatedMeshSceneNode( mesh );
    	
    	if (node)
    	{
    		node->setMaterialFlag(EMF_LIGHTING, false);
    		//node->setMD2Animation(scene::EMAT_STAND);
    		//driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
    	
    		//node->setMaterialTexture( 0,GetIrrlichtManager()->GetDriver()->getTexture( (GetBaseAppPath() + "game/sydney.bmp").c_str() ));
    		node->setMaterialTexture( 0,GetIrrlichtManager()->GetDriver()->getTexture( (GetBaseAppPath() + "game/texture/1.rttex").c_str() ));
    		//node->setMaterialTexture( 0,GetIrrlichtManager()->GetDriver()->getTexture( (GetBaseAppPath() + "game/squirrel_skin.rttex").c_str() ));
    		//driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);
    
    		/*
    		node->setFrameLoop(0, 31);
    		node->setAnimationSpeed(30);
    		*/
    		node->setRotation(core::vector3df(0,0,0));
    		node->setPosition(core::vector3df(0,0,0));
    		
    		//1.3ds
    		node->setScale(core::vector3df(0.05,0.05,0.05));
    	}
    Any help would be appreciate. Big thanks all for view this thread.

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Yes, there is a way to cause Irrlicht to Render AFTER the Proton GUI is rendered.

    Just call this AFTER your GUI stuff is rendered (after BaseApp::Draw(); inside of App::Draw(), or inside a component's OnRender() function)

    Code:
    	GetIrrlichtManager()->BeginScene(); //turn on irrlicht's 3d mode renderstates
    	GetIrrlichtManager()->Render(); //render its scenegraph
    	GetIrrlichtManager()->EndScene();
    Seth A. Robinson
    Robinson Technologies

  3. #3
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Actually, never mind, I miss-read the question. Hmm, I'm not sure where to plug in the Draw2D calls, I haven't used the 2D part of Irrlicht really yet, sorry. Will have to play it first.
    Seth A. Robinson
    Robinson Technologies

  4. #4
    Peasant
    Join Date
    Aug 2012
    Posts
    5

    Default

    Quote Originally Posted by Seth View Post
    Actually, never mind, I miss-read the question. Hmm, I'm not sure where to plug in the Draw2D calls, I haven't used the 2D part of Irrlicht really yet, sorry. Will have to play it first.
    Thanks Seth, I will try it and inform you the result

Similar Threads

  1. After Doomsay MMORPG revenue model
    By jjohn in forum Game development
    Replies: 1
    Last Post: 11-14-2012, 07:28 AM
  2. Best way to render big background?
    By rggjan in forum Official ClanLib SDK Forums
    Replies: 8
    Last Post: 08-11-2011, 02:55 PM
  3. Game won't show in browser
    By Archea47 in forum Funeral Quest
    Replies: 4
    Last Post: 06-04-2009, 11:20 PM
  4. Get game to show up
    By Redsox8118 in forum Funeral Quest
    Replies: 1
    Last Post: 01-24-2008, 01:35 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •