Wednesday, August 27, 2008

as3 geom as class mirror property

Here's a small bit of code I pasted into an as3 geom class to ave the option of inverting the mesh either x,y or z. the uvs work fine

replace function 'v' with:

but first create a mirror var:

public var mirror :String;

private function v(x:Number,y:Number,z:Number):void
{
switch (mirror){
case "x":
verts.push(new Vertex3D(-x,y,z));
break;

case "y":
verts.push(new Vertex3D(x,-y,z));
break;

case "z":
verts.push(new Vertex3D(x,y,-z));
break;

default:
verts.push(new Vertex3D(x,y,z));
break;
}
}


pass the var into the constructor
when you initiate your object
either "x","y","z"

public function coccyx( material:MaterialObject3D=null,mirror:String="", initObject:Object=null )
{
//--\\
//---\\
//---//
this.mirror = mirror


even better would be code for a combination of all three

download th as3 geom class exporter here

Monday, August 25, 2008

papervision 3d

Have loaded a complex model using the as3 geom exporter, which compiles the model information on export, embedding it with the flash swf, avoids parsing the file later on like collada.
Also coded 3d camera movement around the object. I had the object rotating, but want later on to rotate the parts of the object separately. Had trouble finding examples of even camera movement around the object.
It might take a moment to load, will build that in later

Here is the example with markers to show your how the sin() works
also learnt how to UVW unwrap on the way, this example is a box unwrap, hence the shadows. There are not lights in this scene so it needs baked on lights to show the form.
here is the code for the camera movement

sh = stage.stageWidth;
Pi = Math.PI/180;
mY = ((mouseY/sh)*180) * Pi;
mX = ((mouseX/(sh/2))*180) * Pi;
radY1 =mY+1.8;
radY2 =mY+3.2;
radX1 =mX+1.8;
radZ =mX+3.3;


closY1 = 100*Math.sin(radY1);
closY2 = 100*Math.sin(radY2);
closX1 = 100*Math.sin(radX1);
closZ = 100*Math.sin(radZ);

camX = (1*(closX1 * ((-closY2)/100)));
camZ = closZ* ((-closY2)/100);
///


default_camera.x=camX;
default_camera.y=closY1;
default_camera.z=camZ

default_camera.lookAt (objectArray[0]);

Tuesday, July 8, 2008

New project

Having completed my first DIL goal in PHP, I've decided to tackle the apparently more visually rewarding job of exporting a simple polygon model from 3dsMax with Collada or some other conversion plugin which will be read by Papervision 2.0. Import it into a papervision class file, the skeleton for which can be seen <here>, with imported plane with transparent PNG texture.
Then export this with a pre-loader if neccessary for access from BlackBoard.
After I've done that I'll attempt to make the model interactive, so you can click on parts and change there orientation, or pull up information pertaining to them.
Ultimately, if funding becomes available, the scanning of anatomical models kept for the purposes of hands on teaching would enable students to explore objects in cyberspace. The 3d laser scanner here is designed just for that purpose.
The raw mesh will have to be optimized and mapped, even if just baked with a light map for shading, but with the potential for interactive maps - flash movies/animations as textures.
here's a link to some examples(on the right)

Monday, June 16, 2008

swf Projectors transparency capabilities

In the effort to customize my windows XP workstation I have discovered that flash projector applications proclaiming to allow transparent, shaped, applications, are not all they're cracked up to be.
MDM zinc 2.5 loads a transparent flash 8 swf projector after about 5 mintues, and is so slow that proves impossible to use. Flash 9 it won't take at all.
Northcodes swfStudio 3.5 will work but is sticky.
Old flash Ants IceProjector 1.5 flows like sugar compared to these, and supports AS3. Unfortunatley these programms application/system manipulating capabilities run inverse to there graphical prowess. Iceprojector is limited to fsCommands.
Cacheing the moving images as bitmaps seems to have no effect.
Perhaps there is a workaround or MDM 3 is better.

go here to have a look at comparisons
and here for the flash mag review

MDM said...

You should REALLY use MDM Zinc 3.0 - the transparency is flawless, optimized and works perfectly across Windows and Mac OSX now. The transparency in 2.5 is ancient and not worth mentioning. Definately give Zinc 3.0 a go. :)

Too right MDM, version 3 is very nice and smooth, too bad about the watermark;>

Friday, June 13, 2008

Goop

Have been trying to recreate the behaviour of macromolecules, polymers, long chain molecules, which have a kinetic bond. As computers become more ergonomic it seems only natural that they'll appear more organic. Although they have goopyness in the 60s.
LINK

Tuesday, June 10, 2008

Gardening Layout

When I layout my garden, it will be designed like a strip tease, with parts revealed, at certain points, and then concealed, perhaps behind viels, or sunk in shadow. So the viewer will be led on by the mystery of the next bend.
Although it is hard to imagine a garden not only as a 3dimensional space, but also as a temporal, chronological space, like a piece of music. With juxtapositions, and contrast both imediately, and over time.
Bethunes Gulley of Dunedin, is a myterious place, it is huge, and looks as though it may have been part of an ancient, giant long dead civilisation.

here is a map drawn from my minds eye. Of course from here it looks more like an intestine.


when you come out of the tunnel you can see right up the gully.
Once you've crossed the first green you are funnelled towards the foot bridge. Here the bush enclosers the vista, but through it you can make out the terraces beyond.
You cross the bridge and burst out into the second green, and make your way to the top of the steps under the forboding watch of the pines, this is the entry to the Mount Cargill walk.

DIL solution for online courses

Wouldn't it be good if the teachers of an online course had access to a shared file, a central depository that could be added to and subtracted from by all those involved?
At Polytech, there is already such a system in place. What, for an online course would be useful is if those resources could be accessed from the internet by students. If the folder index, which would be readily transposable to blackboard or any html supporting page could provide access to html hyperlinked text, and embedded media such as progressive download video(better for slow connections) and audio, interactive flash files(*.SWFs), and of course images, the teachers and students could be instantly incontact through rich media without the need of a middle man to manage the preparation of files for the web.
But teachers can't waste their time optimizing video and audio so it will be accessible to the slowest backwater dial up trickle, that is why Utube and blip etc are so good.
But what a rigmarole it is just to get videos up and running on those web services.
With a shared folder the process would be instant, and with the right software autimated optimzing can be achieved reliably and with almost any format you can lay your hands on.
So now all your resources are in a standadised format that is accesible for the students through the html pages in which they're embedded.
The html pages can be composed as easily as you would a word file, "inserting" images etc. Inserting links allows you to jump around the resource, to develop multiple depths, digressions, curios, for the avid students, to jump to a glossary etc.

What would be on the web would be what is visible in your shared folder.
Version control would allow teachers to edit a file simultaneously, creating two versions, which could be concatenated as required. Editing a file would create a copy, with each amendations date and amendor visible. Control of what was accessible by students would be in your hands.

I wonder if teachers had a way to compile their text, and all their media in readiness for the web without having to upload files to blackboard or any other web service, infact, to not have to use the web at all inorder to make it accessible for the web,
if a shared hub for all course developement could be made to work?