This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?act=Print&client=printer&f=17&t=268 as retrieved on 2 Aug 2007 22:58:38 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:K-BlBwfw0e4J:www.flashsandy.org/forum/index.php%3Fact%3DPrint%26client%3Dprinter%26f%3D17%26t%3D268+act%3DPrint+%22index+php%22+-lofiversion+site:www.flashsandy.org&hl=en&ct=clnk&cd=91


Google is neither affiliated with the authors of this page nor responsible for its content.
These terms only appear in links pointing to this page: act print index php

Printable Version of Topic

Click here to view this topic in its original format

Sandy's Forum _ AS2 1.x versions _ Sphere Problems

Posted by: Scott W. Jan 16 2007, 02:30 PM

I am a newbie to the 3D world of flash and loving it. To those of you who have helped create Sandy, you have done an outstanding job!! Thanks!

My problem: I am trying to create an ADI (Attitude Display Indicator) for a game I am trying to create. For those of you who dont know what an ADI is, it basically displays the pitch (X), roll (Z), and yaw (Y) of an aircraft using a sphere. The sphere moves freely on all three axes.

I have attached the Actionscript file and the FLA I have been working on to create the effect (Thanks so much to Petit - Your tutorials and examples have been a HUGE help!!). Essentially, I created a sphere and wrapped a movieclip skin around it. I added three input boxes to control the x, y and z. It looks great before I rotate the sphere (even when I do a RotationInterpolator it looks good) but when I use the rot(x,y,z) the sphere gets mangled! It does not render correctly. I've tried doing a refresh and a render on both the group and the sphere itself and neither of those help. Is there something I can do differently to get the sphere to render correctly?

Also, I will be running this swf on a pretty powerful machine as a standalone (the swf will have essentially full usage of the CPU). What techniques can I use to make this look as good as possible. I already changed the quality setting in the sphere class to 14 which helps a ton and still runs pretty smoothly on my machine. I also own a copy of Swift3D (I bought it specifically to do this stupid ADI) but then figured out that it won't work because I can't dynamically set the x, y, and z coordinates.

Any ideas or suggestions?

Thanks so much for any help and keep up the good work!

Scott


Attached File(s)
Attached File  ADITest.zip ( 45.61k ) Number of downloads: 5

Posted by: Petit Jan 16 2007, 05:06 PM

QUOTE(Scott W. @ Jan 16 2007, 03:30 PM) *

Any ideas or suggestions?

Scott: Happy to hear that my tutorial comes to good use wink.gif
About your ADI, it seems to work well with the MisxedSkin, but for the Movieskin some faces are not drawn, when you rotate the sphere. This is a bit strange indeed.

I tried to disable back face culling, the technique to save CPU cycles, by not drawing faces the camera cannot see. This is done on a per object basis. Disabling it means, that all faces will be drawn regardless of wht the camera sees.

Here is what i did. In the createScene() metod I added
CODE
         sphere.enableBackFaceCulling = false;

And voila! For some reason this works, and all faces are drawn also for the MovieSkin.

Question: Why do you use a Movieskin and not a TextureSkin?

The mapping of your image is a bit distorted towards the poles, but I cannot advice you on the matter of UV coordinates, that decides the mapping.

Good luck now!

Posted by: Scott W. Jan 16 2007, 07:09 PM

Petit: Thank you so much! I really didn't expect to hear from you!! Disabling the back face culling worked perfectly (although I have no idea why).

In regards to your question, I chose a MovieSkin because
A) It works! Woo hoo!
cool.gif It seemed like all the other skin options needed a bitmap and since I created the image in flash it is vector. I tried a TextureSkin and passed it the linkage name of the movieclip I created and all I got was the skeleton of the sphere (just the lines) there was no sign of the movieclip image. Are there benefits to using the TextureSkin over the MovieSkin? Is it less CPU intensive? Better image quality (This is the most important aspect to me!!)?

I also noticed that my image was distorted near the poles. I dont know why though. I created the image to be twice as wide as it is high which is all I thought I needed to do to get it to render on the sphere correctly. Am I wrong? Is there a better way to do this to make it look clearer? You mentioned something about UV coordinates and I looked up what that is on Wikipedia but it didn't help out much. Is there something I should know about UV coordinates that would help me here?...Stupid 3D math!

Lastly, I increased the quality of the sphere Class to make it look more...well...spherical. Are there any implications to doing this that I should be aware of besides increased CPU usage?

Thanks so much! (Regardless of whether you are able to respond to this reply or not you have solved my problem!!)

Scott

Posted by: Petit Jan 16 2007, 11:38 PM

QUOTE(Scott W. @ Jan 16 2007, 08:09 PM) *

Disabling the back face culling worked perfectly (although I have no idea why).

In regards to your question, I chose a MovieSkin because
A) It works! Woo hoo!
cool.gif It seemed like all the other skin options needed a bitmap and since I created the image in flash it is vector.

I also noticed that my image was distorted near the poles. I dont know why though. You mentioned something about UV coordinates and I looked up what that is on Wikipedia but it didn't help out much. Is there something I should know about UV coordinates that would help me here?...Stupid 3D math!

Glad to hear that it solved the problem.
I see you point regarding the MovieSkin versus TextureSkin. I don't think you'll win anything by using the latter, but I'm not really sure about that.

As I said I don't know enough on the UV coordinates stuff to advice your.
What I know is that each face has UV coordinates, which are the ( relative ) coordinates of the part of the bitmap, that should be drawn on the face. By relative mean that a value of 0 represents the upper left corner of the bitmap and a value of 1 represents the lower right corner.
Hopefully someone with better knowledge will jump in here wink.gif

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)