POV-Ray : Newsgroups : povray.pov4.discussion.general : Next Generation SDL: What's wrong with Lua, JavaScript, ... : Re: Next Generation SDL: What's wrong with Lua, JavaScript, ... Server Time
15 May 2024 17:04:56 EDT (-0400)
  Re: Next Generation SDL: What's wrong with Lua, JavaScript, ...  
From: SharkD
Date: 12 Apr 2009 21:01:03
Message: <49e28ecf$1@news.povray.org>
clipka wrote:
> Yuck!
> 
> You really want to script scenes using statements like
> 
> scene.objects.MySphere.material.finish.pigment[2].pattern.translation +=
> <a,b,c>?
> 
> Not me!

This is fairly typical when interacting with the DOM in for instance 
JavaScript. Note that you can create variables that refer to entire 
branches in the tree and refer to them later using these variables. So 
you don't have to type out the entire address if you reference an item 
more than once.

i.e.

var MyPigment = scene.objects.MySphere.material.finish.pigment[2]

MyPigment.pattern.translation += <a,b,c>


> Can you give an example about how this separation would look like?
> 
> I guess I'm not getting the picture you're aiming at right now.

Basically what I mean is that the entire scene should be contained 
within a single DOM, and that one should be able to express it in 
shorthand notation.

i.e.

var MyObject =
{
	radius : 1,
	translation : [0,0,1]
}

is shorthand notation for:

var MyObject = new Object();
MyObject.radius = 1;
MyObject.translation = [0,0,1]


> The result of a strict separation can be seen for instance in various
> JavaScript-based dynamic HTML pages: Where content and behavior mix, web
> designers are forced to either include the behaviour with the content
> (JavaScript elements inside the HTML page), or pull some of the content into
> the behavior (separate JavaScript files generating HTML code "on the fly"). The
> result is an ugly hodgepodge of two entirely different languages.

In recent browsers at least, designers aren't "forced" to insert 
JavaScript inside HTML. In fact it's highly discouraged, and is more of 
a sign that the designer doesn't know how to work with proper DOM methods.

-Mike


Post a reply to this message

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