Archive for the ‘Papervision 3D’ Category

Difficulties with Papervision3d when embed width and height in html are 100%

Wednesday, March 12th, 2008

Well it's not really difficulties; more something you have to keep in mind when, in your HTML, you set the width and the height of the flash portion to 100%. In my case I did this so that my swf would take all the browser space.

So I was doing some minor papervision3d programming and everything was going fine until I embedded my swf in HTML. Since the embedded flash size (width and height) wasn't the same as the exported flash size I had some glitches on the papervision3d side. The Viewport3D was the part that moved when I resized the browser. In order to fix this I had to assign it a new x and y at creation that was dependent on the stage width and height. This is how you do it:

Actionscript:
  1. viewport = new Viewport3D(stage.stageWidth, stage.stageHeight, true, true);
  2. viewport.x = -((stage.stageWidth - 800) / 2);
  3. viewport.y = -((stage.stageHeight - 600) / 2);
  4. addChild(viewport);

800 being the original width of my stage and 600 the original height. So by modifying the x and y of the Viewport3D at creation when I loaded the site or reloaded it it was always at the right place. At least that is what I thought until I tested it in Internet Explorer. I guess Internet Explorer doesn't handle resizing of the browser in the same way as Firefox or Opera, because if you loaded the site, then resized the browser and then refresh the page it would not work properly in IE, the Viewport3D would be offseted. Actually in any browser, resizing the browser would offset the viewport making alignment not fit anymore. This is more obvious when you have some parts of your site in papervision3d and some parts under it not in 3D. To fix this I had to add a listener for the RESIZE event on the stage:

Actionscript:
  1. stage.addEventListener(Event.RESIZE, stageResizer);
  2.  
  3. private function stageResizer(e:Event):void{
  4. viewport.x = -((stage.stageWidth - 800) / 2);
  5. viewport.y = -((stage.stageHeight - 600) / 2);
  6.  
  7. }

Every time the browser would be resized this code would align the viewport in the middle of the stage.

This was a minor problem I encountered while using papervision3d; it wasn't really hard to solve, but I guess it will be easier for you to find the answer than for me (since it's all here).

Papervision3D 2.0 - Great White - is out

Wednesday, December 5th, 2007

Today the newest version of papervision3d was released. It's the alpha for the 2.0 version and the code name is Great White. It has a ton of new features like shaders, animated models,  shading, bumpmaping, frustrum camera etc. Tons of words I don't understand yet, but what is more important to me is that it's faster; in fact it's supposed to be about 23% faster.

It's funny because just last weak I was trying it out, I started with version 1.5, then I went to version 1.7. Two days later I was reading the forums and I kept reading about the Phunky Branch, so I tried it, it was version 1.9. Now just one week later version 2.0 is out, I guess I'll have to switch again. It seems like a lot as changed in the Great White branch so I suggest reading this articles by John Grden about how to upgrade current papervision3d projects.

Flex problems again

Thursday, November 29th, 2007

Seems like every time I want to use Flex there is something that prohibits me from doing it. Today I was trying  to make a website using papervision3D; what I want to do is use a grid of video planes. So each of my plane has a MovieMaterial Movie has a FLV embedded in it. Well the thing is that you cannot import FLV files in Flex. So it makes it just more complicated in this case to use Flex and Flash together instead of just using Flash. Oh well, no profiler for me this time either.

Papervision3D experiments with models

Friday, November 23rd, 2007

I did experiments with papervision3D all day long and let me tell you this: starting by trying to import a collada model might not be the right idea at first. I finally succeeded, but not with the model I wanted ...  Actually I never got my model to work but at least I know I am doing every thing right in the Flash IDE since it works for other models. I think my problem either comes from the fact that my model had too much polygons in it or we had trouble when exporting the collada file from Maya. I didn't even code anything, I just used the papervision3D component and panel inside Flash. Its great, but I didn't get it to work properly. It is supposed to give you a preview as you are designing but that part didn't work. What did work was the change I was making inside the panel did show up when I compiled the movie.

It's kinda hard to learn how to use papervision3D, at least the part about importing a model. I know gotoandlearn.com has some nice tutorials not about using model but what helped my the most is this post from John Grden. The video at the end shows you how to use the component and the panel.

Really nice papervision3D website

Friday, November 9th, 2007

While browsing the papervision3D blog, I found a link to the new site for the Canon EOS 400D. I can say that it is absolutely amazing. The design is really nice and papervision3D is used in a way that it adds to the experience, not just to show off some cool 3D. It is in fact very subtle and it is that subtility that makes it awesome. Papervision is really nice, but it has some flaws, like the edges of a plane are usually not that smooth, but in this site, they used Papervision3D in a way that it didn't show. Well nice work!

Just in time papervision3D example

Thursday, October 11th, 2007

Yesterday I spoke about Papervision3D; well today's FWA is a site made using Papervision3D and it's quite amazing. I also found a blog post from the company explaining the process they went trough.  Ah yeah, by the way the website is this one, Sony Bravia. Also I have found a tutorial giving you the big steps to make good models for papervision3D. I'll be sure to read it.

I also read a lot about design patterns today, and I really ask myself if it really applies to Flash and simple interfaces, because implementing a MVC (Model-View-Controller) pattern for each and every button seems a bit too much. I'm trying to keep an open mind, but sometimes object-oriented programming seems cool in theory but far from practice... Maybe if I keep on reading...

9-slices scaling, Papervision 3D, Tweener and FlashDevelop

Wednesday, October 10th, 2007

I am currently working on a website with tons of rounded corners, so I'm pretty happy they added 9-slices scaling in Flash 8. The only problem I had today, was that I wanted to apply 9-slices scaling on a mask and it happens that you just can't. You can't do it using ActionScript and you can't use it using the Flash Authoring tool. I don't know about flash 9, but I sure hope they will get that to work.

I also stumbled upon something that looks pretty cool: Papervision 3D . The name says it, you can use it to do 3D in flash, haven't tried it yet but it looks sweet. And while browsing their website I found a nice example using Tweener which I spoke off recently. They'll both deserve more investigation.

Finally, on the same project I am working with all those rounded corner I am using FlashDevelop. I use it because I find the Flash Authoring tool to be realy bad (Flash 8 ) for ActionScript. Well I said FlashDevelop was good, but I would rectify what I said, and now say that it is still experimental. I had all sort of problems with it, mostly with the auto-completion tool completing things all the time which I didn't ask for . Just thought I'd share that with you.


Close
E-mail It