POV-Ray : Newsgroups : povray.general : A new SDL Idea : Re: A new SDL Idea Server Time
31 Jul 2024 12:22:44 EDT (-0400)
  Re: A new SDL Idea  
From: andrel
Date: 17 Oct 2007 16:07:26
Message: <47166C81.9050801@hotmail.com>
Bryan Valencia wrote:
> andrel wrote:
>> I think the main problem with this approach is that you assume you 
>> always know what is in the file. That is a dangerous assumption if you 
>> write a library. It is also not important from a POV point of view, 
>> whatever it is that you load, you can translate, scale and texture it, 
>> so it is an object.
>> Warp's question was if .obj files can be anything apart from meshes 
>> i.e. if it can harm if you put the result in a mesh. Technically for 
>> an .obj file there may not be a danger, but conceptually it is wrong 
>> because other files can contain other objects and you don't want .obj 
>> loading routines to behave different from, say, .off files.
> 
> 
> Typical behavior in the programming world is that when a mesh tries to 
> open another file, it acts the same as when you (for instance) try to 
> open a .wav file in paint.  You would get an exception.
> 
> If there were a wavefront object file were opened by a 
> nurb.loadfromobj(), it would raise an exception.  The filename is 
> irrelevant, except to make it a little easier to use the default 
> file-open dialogs on it.
> 
> Think of it this way:  if you load an image in POV of type "jpeg" and a 
> filename of "MyImage.png", the parser barfs.  Ditto if you did #include 
> "command.com".

I agree (apart from the parser barf, that is a runtime error. The 
association of an extension to a format is a windows thing and POV isn't)

> It would be the same here - the language can't load raw SDL into a Mesh 
> container.

and here we part ;) It may be this way if it were implemented your way, 
but my point was that it shouldn't.
Please explain why the user has to know what is in a file when writing a 
POV script or library.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.