POV-Ray : Newsgroups : povray.general : A new SDL Idea Server Time
31 Jul 2024 12:17:38 EDT (-0400)
  A new SDL Idea (Message 99 to 108 of 118)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Bryan Valencia
Subject: Re: A new SDL Idea
Date: 16 Oct 2007 16:28:29
Message: <47151eed@news.povray.org>
Just FYI, I never recommended scrapping the SDL or orphaning non-windows 
users. All I really wanted was to divorce the editor/parser from the 
renderer (not execute the parser/editor).

If that happened the first thing I would do is to make a mesh object 
that accepts quads as well as triangles, and has .loadfrom3DS and 
.loadfromOBJ methods.


POVMesh myMesh = new POVMESH.loadfrom3DS("Somefile.3DS");
myScene.addObject(myMesh);



-- 
Bryan Valencia

"I'd rather live with false hope than with false despair."


Post a reply to this message

From: Warp
Subject: Re: A new SDL Idea
Date: 16 Oct 2007 16:33:54
Message: <47152031@news.povray.org>
Bryan Valencia <209### [at] gmailcalm> wrote:
> POVMesh myMesh = new POVMESH.loadfrom3DS("Somefile.3DS");

  Why the obsession with 'new'?

  How about:

Object o = import3DS("Somefile.3ds");

  More abstract, less confusing syntax. No need for useless 'news'.

-- 
                                                          - Warp


Post a reply to this message

From: Bryan Valencia
Subject: Re: A new SDL Idea
Date: 16 Oct 2007 17:39:56
Message: <47152fac$1@news.povray.org>
how about

public static mesh loadfrom3DS(string filename)
{
	//write the code to import 3DS files here.
}

then we can do this:

POVmesh myMesh = loadfrom3DS("somefile.3ds");

//sorry the object keyword is already taken.



---

*runs for cover*

Warp wrote:
> Bryan Valencia <209### [at] gmailcalm> wrote:
>> POVMesh myMesh = new POVMESH.loadfrom3DS("Somefile.3DS");
> 
>   Why the obsession with 'new'?
> 
>   How about:
> 
> Object o = import3DS("Somefile.3ds");
> 
>   More abstract, less confusing syntax. No need for useless 'news'.
> 


-- 
Bryan Valencia

"I'd rather live with false hope than with false despair."


Post a reply to this message

From: andrel
Subject: Re: A new SDL Idea
Date: 16 Oct 2007 17:54:45
Message: <4715342A.6040004@hotmail.com>
Bryan Valencia wrote:
> how about
> 
> public static mesh loadfrom3DS(string filename)
> {
>     //write the code to import 3DS files here.
> }
> 
> then we can do this:
> 
> POVmesh myMesh = loadfrom3DS("somefile.3ds");
> 
> //sorry the object keyword is already taken.
> 
And why would this not be one?


Post a reply to this message

From: Alain
Subject: Re: A new SDL Idea
Date: 16 Oct 2007 22:52:29
Message: <471578ed@news.povray.org>
Bryan Valencia nous apporta ses lumieres en ce 2007/10/16 17:39:
> how about
> 
> public static mesh loadfrom3DS(string filename)
> {
>     //write the code to import 3DS files here.
> }
> 
> then we can do this:
> 
> POVmesh myMesh = loadfrom3DS("somefile.3ds");
> 
> //sorry the object keyword is already taken.
> 
> 
> 
As a mesh IS an object, you can use: object MyMesh = import3DS("MyObject.3ds") 
without any problem nor any conflict.
Here, import3DS(...) is a new function that return a mesh object from a .3DS 
file. It can have a different name if the developing team prefer, such as:
load3DS, loadfrom3DS, ... or load_object(<object_type>, "Object_Name")

-- 
Alain
-------------------------------------------------
Where the press is free and every man able to read, all is safe.
Thomas Jefferson


Post a reply to this message

From: Bruno Cabasson
Subject: Re: A new SDL Idea
Date: 17 Oct 2007 05:05:00
Message: <web.4715cf18bcc3cc02e8ba46670@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Bryan Valencia <209### [at] gmailcalm> wrote:
> > POVMesh myMesh = new POVMESH.loadfrom3DS("Somefile.3DS");
>
>   Why the obsession with 'new'?
>
>   How about:
>
> Object o = import3DS("Somefile.3ds");
>
>   More abstract, less confusing syntax. No need for useless 'news'.
>
> --
>                                                           - Warp


In order to keep current syntax spirit, I would rather propose something
like:

    my_mesh = mesh
    {
        load_file {obj "victoria.obj" [obj-specific options]}
        //load_file {3ds "zorg.3ds" [3ds-specific options]}

        ...

        [OBJECT MODIFIER (= methods calls? like translate, subdivide ...)]
    }

    object {my_mesh texture {...}}


Bruno


PS:
The creation block could stand for
    Mesh my_mesh = new Primitives.Mesh();
    my_mesh.load_obj_file_("victoria.obj", ...);

The object{...}  block could stand for
    Texture my_mesh_texture = new Texture(...);
    my_mesh.setTexture(my_mesh_texture);
    Scene.add(my_mesh);

This kind of notation is classical in OO, but not POV-like. I try to find a
notation that ressembles POV, but uses underlying OO features and general
notational principles. Until now, I had no feed back (I hope it does not
mean I am totally wrong ...)


Post a reply to this message

From: Warp
Subject: Re: A new SDL Idea
Date: 17 Oct 2007 06:45:42
Message: <4715e7d6@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> As a mesh IS an object, you can use: object MyMesh = import3DS("MyObject.3ds") 
> without any problem nor any conflict.
> Here, import3DS(...) is a new function that return a mesh object from a .3DS 
> file. It can have a different name if the developing team prefer, such as:
> load3DS, loadfrom3DS, ... or load_object(<object_type>, "Object_Name")

  The important thing, IMO, is that it doesn't hard-code that what is
returned by the function is precisely a mesh. It should be more abstract
than that.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: A new SDL Idea
Date: 17 Oct 2007 06:47:06
Message: <4715e82a@news.povray.org>
Bruno Cabasson <bru### [at] alcatelaleniaspacefr> wrote:
> In order to keep current syntax spirit, I would rather propose something
> like:

  The problem is that it hard-codes that the imported object is a mesh.
(Can .obj files contain other things too, such as NURBS or whatever?)

-- 
                                                          - Warp


Post a reply to this message

From: Bruno Cabasson
Subject: Re: A new SDL Idea
Date: 17 Oct 2007 09:30:00
Message: <web.47160e0abcc3cc02e8ba46670@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Bruno Cabasson <bru### [at] alcatelaleniaspacefr> wrote:
> > In order to keep current syntax spirit, I would rather propose something
> > like:
>
>   The problem is that it hard-codes that the imported object is a mesh.
> (Can .obj files contain other things too, such as NURBS or whatever?)
>
> --
>                                                           - Warp

Well, ok, right, I agree 100% ... But that's not really the problem of the
principle that POV4 syntax should resemble current one. I don't know about
obj format, but the 'load_file' method of meshes can do such an assumption,
and focus on meshes in the file. However, the 'obj specific options' are
here to tell the import method what to do, like access the target object
through its name or whatever obj format is like.

Then, if 'name' is an attribute of obj format:

my_mesh = mesh
{
    load_file {obj "victoria.obj" name "victoria_body"  [other obj-specific
options]}
    ...
}

I do not address specific details, but the overall principles of the syntax.


Bruno.


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: A new SDL Idea
Date: 17 Oct 2007 13:43:14
Message: <471649b2$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Warp wrote:
> Bruno Cabasson <bru### [at] alcatelaleniaspacefr> wrote:
>> In order to keep current syntax spirit, I would rather propose something
>> like:
> 
>   The problem is that it hard-codes that the imported object is a mesh.
> (Can .obj files contain other things too, such as NURBS or whatever?)
> 
	.obj files can't, but other formats can. So how about:

victoria = object {
   load_file {obj "victoria.obj" [obj-specific options]}
   //load_file {3ds "zorg.3ds" [3ds-specific options]}

   ...
}

object { victoria }

	This would apply to formats that contain other object types, while
keeping a syntax that's closer to the current one.

		Jerome
- --
+------------------------- Jerome M. BERGER ---------------------+
|    mailto:jeb### [at] freefr      | ICQ:    238062172            |
|    http://jeberger.free.fr/     | Jabber: jeb### [at] jabberfr   |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHFkmxd0kWM4JG3k8RAqF5AKCLBvv5YMinWIdxiPGsJcuIZ7f++wCfTEy/
pkalLzOY4QKdfsLgvKJFOzU=
=6+RN
-----END PGP SIGNATURE-----


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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