From 0.89.1 to 0.89.3: new features, fixed bugs, performance improvements
By dcantor . March 22, 2013 . changelog. |
By dcantor . March 22, 2013 . changelog. |
The following is a summary of what is new or what is changed since version 0.89.1 to version 0.89.3. There are lots of new features such as:
We have also fixed some bugs, eliminated some useless functions and improved the performance of the platform. Check it out!
1. Some actor operations (property setters) now return the actor instance.
This allows the chain of commands pattern:
for example:
var actor = vxl.c.scene.getActorByName('sphere'); actor.setColor(0.4,0.4,0.5).setPosition(3,3,3).setOpacity(0.5);
vxlCamera
has been replaced by the forward axis. This is just a change_normal
has been replaced by_forward
.vxl.def.camera.type.EXPLORING
type which is now the modelookAt(actor)
and closeUp(actor)
have been fixed!!Now it is possible to use the Command key in Mac to perform dollying (zoom). It was tricky
to use the control key on mac because in some cases it triggers a pop up depending on the
browser version on Mac.
From this version on, if you have a Mac, you can use Command key + mouse drag to perform dollying.
vxlCell.setColor()
Actors can be associated and handled as a whole using the new class vxlActorGroup
. To create
an actor group simply request it from the scene
var scene = vxl.c.scene; var actorGroup = scene.createActorGroup("theNameOfTheActorGroup",listOfActors);
then you can do things such as:
actorGroup.setOpacity() actorGroup.setProperty('propertyName', propertyValue)
Just like actor operations, actor group operations are chainable:
actorGroup.setOpacity(0.4).setColor(0.3,0.4,0.2);
setProgram
: new option to force it
getProgram
: this might be variable if an actor decides to change program it will capture
the current program being used.
New methods:
setUniform(uniformName, value)
— affects the current programsetUniformDefault(programID, uniformName, value)
— not necessarily in the current program.-overrides a value if the program has been loadedgetUniformList()
this way the programs can be configured from the API whether or not they are in use.
The phong and texture tests reflect these changes (see test-phong.html and test-texture.html)
Enabling flat shading and fast cell picking for high-res models.
Models can be of the type vxl.def.model.type:SIMPLE
, MESH
or BIG_DATA
This type identifies how much information has the model and how it should be treated by voxelent.
vxlRenderEngine
will use this type to determine if there are needs for renderable parts (vxlRenderable
).
vxlCell
now requires a reference to the vxlMesh
it belongs and an index. This enables
fast updating of the vxlMesh
model (for instance to change the color of a cell)
1. Renderables belong now to the vxlActor
class. The idea behind it is to make sure that
the actor representation on screen is different from the model This way we can have several actors
based on the same model. Each one with different properties. For instance, two actors based on the
same model but each one using a different lookup table. To achieve this, it is necessary that the colors are stored in the material
of the actor (vxlMaterial
) instead of using the vxlModel
colors (which are used initially if they exist)
The vxlRenderable reads the model information from vxlMesh
model if the actor has one
or from the actor model if it is of type big data.
vxlRenderStrategy
has been renamed to vxlRenderEngine
1. Now the familiar vxl.api.load
routine support VTK files too!
Before this release, VTK files could only be added through drag and drop.
vxlRenderEngine
, vxlScenevxlPicker
has been debugged and optimizedNew methods:
vxl.api.loadSequence('part',1,40,'/the/path');
vxl.api.solidWireframeON(true|false);
vxl.api.setFieldOfView(number [0-360]);
Removed methods:
vxl.api.setCameraDistance
The concept of material has been added to voxelent. (See vxlMaterial
on jsdocs).
Each actor has now a material object that contains elements such as:
You can still change these properties through the respective set* methods in
vxlActor
,
You can still query these properties through vxlActor.getProperty
Additionally you can access the material and set the properties directly, like in:
actor.material.shading = false;
vxlLambertStrategy
, vxlPhongStrategy
, vxlRenderStrategy
and vxlBasicStrategy
are now merged into vxlRenderStrategy
vxl.api.setProgram
and vxlRenderer.setProgram
, the strategy now is optional.vxlRenderStrategy
has combined both the former lambert and phong strategies.The actor shininess property has been defined. the default strategy evaluates this property
to decide the proper program to use (lambert vs phong). See vxlDefaultStrategy
actor.setShininess(100); //the lower the value the bigger the specular reflection actor.setProperty('shininess',200); //also can be set this way
setMagFilter
and setMinFilter
are availablvxlTexture._onError
)Now object picking is available as promised in 0.89.1. Use:
actor.setPicker(vxl.def.actor.picking.OBJECT, callback)
where callback can be any function that receives two arguments:
function whateverNameCallbackFunction(actor, uid)
vxlCamera.setFieldOfView
has been added, there is an accessible method on the APIvxl.api.setFieldOfView
)The old vxlCameraState
has been replaced by vxlLandmark
The new camera methods are available:
setLandmark
goTo
getLandmarks