OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Pls help me! Why osgDB::readNodeFile return a NULL value!


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [forum]
View previous topic :: View next topic  
Author Message
QuangNam
Newbie


Joined: 31 Oct 2014
Posts: 14

PostPosted: Fri Oct 31, 2014 2:32 am    Post subject:
Pls help me! Why osgDB::readNodeFile return a NULL value!
Reply with quote

Hi,

I am a new OSG, nice to meet everyone!

i has a problem when i do a MFC project.

my osgDB::readNodeFile() always return NULL! (pic)



sorry i can not upload a picture. This is link: ( space between 'uphinhnhanh.' and 'com'.

Code:
void cOSG::InitSceneGraph(void)
{
    mRoot  = new osg::Group;

   mModel = osgDB::readNodeFile(m_ModelName);
   if (!mModel) return;

    osgUtil::Optimizer optimizer;
    optimizer.optimize(mModel.get());
    optimizer.reset();

    mRoot->addChild(mModel.get());
}


uphinhnhanh. com/images/500xNx98452265634OSGProb.png.pagespeed.ic.rdmCrAujLm.png
Please help me
...


Thank you!

Cheers,
Nguyen Confused
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10855

PostPosted: Sun Nov 02, 2014 12:58 pm    Post subject:
Pls help me! Why osgDB::readNodeFile return a NULL value!
Reply with quote

Hi Nguyen,


There a range of things that can result in the readNodeFile() from return NULL.


You don't really provide any details about what type of file you are attempting to load, it may or may not be of a type that the OSG can load. 

Another alternative could be that you simply haven't set the paths up correctly to find the file.


Another possibility is that you may not have set up the paths to the directory that contains the plugin directory.


There are docs on getting started, and books.  I would recommend having a look at these.

Robert.



On 31 October 2014 02:32, Nguyen Quang Nam < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,

I am a new OSG, nice to meet everyone!

i has a problem when i do a MFC project.

my osgDB::readNodeFile() always return NULL! (pic)



sorry i can not upload a picture. This is link: ( space between 'uphinhnhanh.' and 'com'.


Code:
void cOSG::InitSceneGraph(void)
{
    mRoot  = new osg::Group;

        mModel = osgDB::readNodeFile(m_ModelName);
        if (!mModel) return;

    osgUtil::Optimizer optimizer;
    optimizer.optimize(mModel.get());
    optimizer.reset();

    mRoot->addChild(mModel.get());
}



uphinhnhanh. com/images/500xNx98452265634OSGProb.png.pagespeed.ic.rdmCrAujLm.png
Please help me
...


Thank you!

Cheers,
Nguyen Confused

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61474#61474




Attachments:
http://forum.openscenegraph.org//files/osgprob_320.png


_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Chris Hanson
Guest





PostPosted: Mon Nov 03, 2014 1:04 am    Post subject:
Pls help me! Why osgDB::readNodeFile return a NULL value!
Reply with quote

On Sun, Nov 2, 2014 at 5:54 AM, Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Another possibility is that you may not have set up the paths to the directory that contains the plugin directory.


This is the most common failure. Ensure OSG is able to find the plugins.


Also, turn up the OSG NOTIFY settings to DEBUG:


http://trac.openscenegraph.org/projects/osg//wiki/Support/TipsAndTricks


in order to gather as much information as possible.


--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
QuangNam
Newbie


Joined: 31 Oct 2014
Posts: 14

PostPosted: Sat Nov 08, 2014 11:10 am    Post subject:
Thank you :)
Reply with quote

Hi, Rober, Chris!

Robert: Thank you! I am a new osg-er but i read a project first and do with it. It may be bad. Thank for your advise Smile
Chris: Thank you! It help me alot Exclamation
Back to top
View user's profile Send private message
QuangNam
Newbie


Joined: 31 Oct 2014
Posts: 14

PostPosted: Tue Dec 16, 2014 4:36 pm    Post subject:
Pls help me! Why osgDB::readNodeFile return a NULL value!
Reply with quote

Hi, Rober, Chris!

Robert: Thank you! I am a new osg-er but i read a project first and do with it. It may be bad. Thank for your advise Smile
Chris: Thank you! It help me alot [Exclamation]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61548#61548







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [forum] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts ref null pointer in Group::traverse Meldryt General 1 Thu Mar 16, 2017 3:06 pm View latest post
No new posts Having problems running the osgViewer... retrotrap General 2 Thu Nov 24, 2016 12:43 pm View latest post
No new posts Error with osgDB::readRefNodeFiles[So... robertosfield General 3 Tue Oct 04, 2016 11:15 am View latest post
No new posts invalid use of incomplete type ‘std... jihwaja General 14 Mon Sep 12, 2016 11:34 pm View latest post
No new posts slow speed of osgDB::writeImageFile()... cbuchner1 General 0 Mon Sep 12, 2016 9:09 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP