Marcus Lindblom wrote: > Christoph Fünfzig wrote: > >> Hi Marcus, >> >> Marcus Lindblom wrote: >> >>> Hi all, >>> >>> There's stuff happening on the wiki. I like that. I prefer to give my >>> comments here though, as it's easier to keep track on the discussions. >>> >>> == FileIO == >>> >>> On handling realtive paths. We need to decide between implicit or >>> explicit management. I proposed implicit first (storing curren path for >>> each protocol & thread) but have lately moved to explicit (loaders are >>> responsible for mapping that) as I think the first is too error prone >>> and not really worth the effort (it is sexy, I'll admit to that, but how >>> much maintenance will it require? ;). >>> >>> I've also put in some sample code there, to try to clarify some concepts. >>> >>> Comments? >>> >>> >> Explicit handling is easier, but then you have to implement the rules >> for referenced content inside the SceneFileType. But I think >> it is the right way to start with. >> The scenario which occurs most often, is like this >> SceneFileType gets URL of scene root >> and has to handle relative, absolute or URL paths to content it references. >> URL paths are easy. >> Should relative or absolute paths always stick with the content provider >> of the scene root? >> > > I was thinking that we'd only use URL paths to talk to content providers > and that the future of today's PathHandler would be to convert regular > file paths (relative or absoulute) into file:// - URLs, which are passed > on to the right loader. > > What do you mean by the paths 'sticking to the content provider of the > scene root'? > > Sorry, a bit intricate. I give an example for an OBJ scene
[karl.obj] references [karl.mtl] # karl.obj mtllib ./karl.mtl g v -0.160198 0.833276 0.084171 ... [karl.mtl] references textures [textures/karlbacknr1.tif][textures/karlbacknr2.tif][textures/karlbacknr3.tif] # karlT.mtl - materials of textured Karl. newmtl karlbacknr1 Ka spectral ident.rfl 1.0 Kd spectral ident.rfl 1.0 Ks spectral ident.rfl 0.5 illum 2 Ns 30.0 map_Ka textures/karlbacknr1.tif ... [textures/karlbacknr1.tif] [textures/karlbacknr2.tif] [textures/karlbacknr3.tif] Now, you publish the scene on a webserver http://home.dummy.net in directory /models, /models/textures You can identify the scene file with URL http://home.dummy.net/models/karl.obj, but the contained references are still relative paths. So the OBJSceneFileType has to generate the URLs http://home.dummy.net/models/karl.mtl and http://home.dummy.net/models/textures/karlbacknr1.tif from them! What are the possible cases (e.g. all in one ZIP file karl.zip on the webserver) here and where should the resolution of absolute/relative paths (into URLs, layered URLs) happen? Christoph ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
