delta3d
 Forum Index >  > delta3d Support New Topic Post Reply
 dtRender and Ephemeris
Prev Topic Next Topic
   
Arisey
 09/23/2014 09:39PM (Read 821 times)  

Newbie

Status: offline
Forum User

Registered: 08/25/2014
Posts: 8
Hello everyone. I'm using the version 2.8 to test some things and seeing this made ​​testApp example, I have a doubt as actor type dtRender be added to make use of Ephemeris in my project. In the example testApp actors dtRender've seen that type added with the BaseMap file but would like to know as from code.
 
Profile Email
 Quote
banderegg
 09/24/2014 07:55PM  

Admin

Status: offline
Site Admin

Registered: 05/17/2005
Posts: 568
Hi, Thanks for helping with the testing. The dtRender library adds a new environment game actor called the SceneManager which allows for organizing the scene structure into different groups with node masks used to allow different graphics operations to render specific subscenes. To use the Ephemeris Scene you just need to add the Scene Manager and Ephemeris Scene to your map. If you aren't using a map then you can simply create the actors by type using the GM and add them yourself. Did this answer you question? If not please clarify what you would like to do. Thanks, Brad
 
Profile Email Website
 Quote
Arisey
 09/24/2014 09:22PM  

Newbie


Status: offline
Forum User

Registered: 08/25/2014
Posts: 8
Ok, thanks for the reply and could add ephemeris from code but would like to know if it is or is there a better way. Me everything works, see the sun, the stars and the moon. I have added clouds and rain but I wonder if so the best implementation fails me or something. This is the code:
PHP Formatted Code

prepareEnvironment() {
        pGameManager -> LoadActorRegistry( "dtRender" );
        dtCore::RefPtr< dtCore::BaseActorObject > proxySM = pGameManager -> CreateActor( "dtRender", "Scene Manager" );
        if( !proxySM.valid() )
                return;

        pSM = static_cast< dtRender::SceneManager* >( proxySM -> GetDrawable() );
        pSM -> SetSceneCamera( GetCamera() );
        pEphemerisScene = static_cast< dtRender::EphemerisScene* >( pGameManager -> CreateActor( "dtRender", "Ephemeris Scene" ) -> GetDrawable() );

        pSM -> AddActor( *(( dtCore::DeltaDrawable* )pEphemerisScene ));
        pGameManager -> AddActor( *proxySM );

        pEphemerisScene -> AddChild( oTerrain.get() );
        pEphemerisScene -> SetVisibility( 100 );


        dtCore::RefPtr<dtCore::CloudDome>  cd;
        dtCore::RefPtr<dtCore::CloudPlane> cp[3];

        cd = new dtCore::CloudDome(6, 2, 0.7, 0.5, 0.7, 5, 5500.0f, 20);
        cp[0] = new dtCore::CloudPlane(6, 0.5, 6, 1, .3, 0.96, 256, 1800);
        cp[1] = new dtCore::CloudPlane(6, 0.7, 12, 1, .4, 0.95, 512, 1000);
        cp[2] = new dtCore::CloudPlane(6, 0.8, 20, 1, .2, 0.96, 512, 600);

        pSM -> AddChild( cd.get() );
//      pSM -> AddChild( cp[ 0 ].get() );

        osg::ref_ptr< osgParticle::PrecipitationEffect > precipNode = new osgParticle::PrecipitationEffect();
        precipNode -> setParticleSpeed( 0.4 );
        precipNode -> rain( 0.3 );
//      precipNode -> snow( 0.3 );
        precipNode -> getFog() -> setFogCoordinateSource( osg::Fog::FRAGMENT_DEPTH );
        GetScene() -> GetSceneNode() -> addChild( precipNode.get() );
}
 
And a little picture of what I have ...
 
Profile Email
 Quote
banderegg
 09/24/2014 10:40PM  

Admin

Status: offline
Site Admin

Registered: 05/17/2005
Posts: 568
That's great! Typically we create and load multiple maps. The first map loads the scene structure, and in 2.9 (already on the trunk) can have GM Components that is designed to stay loaded when the main map loads and unloads. The main map contains the actual scene geometry and actors which will be un loaded when the 'level' changes. TestApp always loads BaseMap, and then it will load another map as a command line argument. So ideally you make your custom map and then pass it to TestApp and it will load it with the same scene structure used in the demo. If you want to edit the ephemeris (more properties coming shortly) or any of the other scenes (shadows, cubemaps, hdr, water, etc) you can modify BaseMap or make your own. Hope that helps, with any luck we will get around to making tutorials as this stuff is all relatively new.
 
Profile Email Website
 Quote
mail863
 05/13/2017 11:25AM  

Newbie

Status: offline
Forum User

Registered: 05/07/2017
Posts: 3
That's great, followed this tutor, I setup my first 3D Scene. However, I still cannot setup oceanscene, could you explain more? Thanks in advance
 
Profile Email
 Quote
Content generated in: 0.57 seconds New Topic Post Reply
 All times are UTC. The time is now 08:46 AM.
Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 

About delta3d

delta3d is a game and simulation engine appropriate for a wide variety of simulation and entertainment applications. delta3d uses best-of-breed open source technologies to create a fully integrated game engine and with content creation tools.MORE

Twitter

User Functions





Don't have an account yet? Sign up as a New User!

Lost your password?