ActionScript 3.0 :: Away3d AbstractPrimitive Is Wrapping Faces In Bitmap Rather Than Itself
Jan 14, 2011
I'm working in Away3d and have hit a road block.I'm creating an abstract primitive (that looks like a pentagon) made from 5 faces, each of which is determined by dynamically generated vertices. I can't just use the regular polygon class because the placement of the object has to be exact.
Here's the issue:I need to 'cover' the abstract primitive in a bitmap.So all five faces need to be covered in one bitmap.But my code (below) results in each face getting covered by its own bitmap.So instead of looking like a pentagon covered with the image, you can see each face individually covered by a different copy of the bitmap.
var ap:AbstractPrimitive = new AbstractPrimitive();
var bmm:BitmapMaterial = new BitmapMaterial(Cast.bitmap("roundDoor"));
ap.bothsides = true; [code]....
View 3 Replies
Similar Posts:
Aug 26, 2010
The problem relates from trying to create BitmapMaterials from scaled bitmap images. Away3D is being used, but I guess the principles at work are general. The source images are of different sizes and scales. The idea is to map the images onto a 400*300 mesh, adding empty space to the sides of the image when the scales differ - so, for example, an overwide image would be scaled down to have a width of 400, with blank space being used to fill gaps at the top and bottom of the image. An initial function creates a mesh, and adds two faces using the material. This works perfectly. However, a near identical function is used to remove the faces and replace them with new faces using a different image, and this produces an incorrect scale - the faces end up displaying the zoomed center of the source image.
Here's the ActionScript Code:
//WIDTH = 400 , HEIGHT = 300
var loadedBitmap:Bitmap = event.currentTarget.content as Bitmap;
var newBitmapData:BitmapData = new BitmapData( WIDTH, HEIGHT, true, 0xff );
var targetRect : Rectangle = new Rectangle( 0, 0, loadedBitmap.width,
loadedBitmap.height );
[Code] .....
View 1 Replies
Oct 3, 2009
I made a game and i had 3 faces on it. Now i added one more and when i play it, i see only two.
[Code]....
View 5 Replies
Feb 8, 2012
Does 3d work in flash? If so, links to a quick tutorial? All I want to figure out is how would one draw a block on stage. Bonus points if you can tell me how I can have 6 movieclip on each of the 6 faces on the cube.
View 2 Replies
May 12, 2004
I DL the kirupa source code 3D ButtonCube and i am wondering how can add/attach a different link to each faces? Basically i want to make this 3D cube function like a menu.
View 1 Replies
Jul 9, 2011
I followed the following article to deal with ViewExpiredException -
It does what it is supposed to do. But I wanted to have some FacesMessage displayed on view if the user was redirected to it due to ViewExpiredException. So, I added a FacesMessage before redirection using NH.handlenaviage(). But it didn't work, and the reason was that the FacesMessage survived only one Request Processing Cycle.
At first my solution was to save the message in the session and retrieve it before Restore View phase of next cycle.
Even though it worked, I started looking for some standard solution and the first thing that I came across was the following article -
Persist and pass FacesMessages over multiple page redirects
But it didn't work. I think it's because the PhaseListeners are executed before ExceptionHandlers. So, in this case it was useless.[code]...
View 1 Replies
Jul 12, 2009
I've got a game were you click and a plane moves towards that spot, the problem is making it face were you clicked. i can get it so that the plane faces towards the mouse but thats not really what i want.
View 2 Replies
May 12, 2004
I downloaded the kirupa source code 3D ButtonCube and I am wondering how can add/attach a different link to each faces? Basically I want to make this 3D cube function like a menu.
View 1 Replies
Nov 28, 2011
I have a question about Papervision3D, or perhaps bitmapData, I am unsure where the problem is. I have constructed a program that takes 4 banners and splits them into pieces and then applies those pieces to cubes so that I can make a banner rotator. So after I run my program I have 10 cubes with a piece of a banner on 4 faces(front, top, back, bottom) of each cube. The problem is that some of the faces are oriented incorrectly(spun 180 degrees). Is there a way in Papervision3D to spin a cube face? The other place I think the problem may be is when I create the bitmapData that will be applied to the cube faces.
View 3 Replies
Dec 16, 2011
I am trying to create an avatar that faces the position of the cursor and follows a walking loop while it moves towards the mouse click anywhere on the stage. I need certain walking loops that are used by the script when the cursor is either North, Diagnal positions etc. Also I need the same when its idle.
View 0 Replies
Sep 3, 2009
I have recently been developing a sailing game and my boat turns with the arrow keys. On the turn i would like to keep the boat constantly moving forward in the direction it faces. What is the simplest way to do this?
(When i rotate the boat to the right/left, i want the boat to move that direction)
View 2 Replies
Aug 1, 2009
Does anyone know how to wrap a .mov file into a swf?
View 7 Replies
Sep 26, 2006
I'm doing an art project in Flash where I'd like to make realalistic line drawings of girl's faces with lines represing long flowy hair. I want to make the hair appear to be flowing in the air as if a cool breeze is blowing on it.
I tried drawing these lines for the hair flowing in the air frame by frame, but it just doesn't look natural. I was wondering if anyone knows of a solution I should do with Action Script. I have a couple specific questions in addition to my request for an AS solution to create the look of natural looking flowing hair.
1) Can AS create photorealistic natureal looking hair?
2) Can AS creates a natural looking animation of the hair moving in a sequential, breezy flow?
3) If yes and yes, how can the file size be kept low while still maintaining the apperance of a photorealistic drawing?
View 4 Replies
Dec 9, 2010
So for a site I would like to have 2 swfs, mainContainer(just has preloader) and index(contains all assets)
This will allow me to have a nice, 0%-100% preloader.
However during development I will just be publishing index. So to start my chain of functions, I have my document class for index like this:
ActionScript Code:
public class index extends MovieClip
{
var path:MovieClip;
[Code].....
However, this will fail when index is loaded in to mainContainer, because the code gets run before I addChild on to the mainContainer displayObject.
So I need a way to detect whether index is loaded or not in another swf. How's that possible?? There doesnt seem to be an easy way.
View 4 Replies
Sep 7, 2009
Is there any tool, plugin or extension that can help me in text wrapping on a circular path in Flash CS4.
View 1 Replies
Jun 28, 2010
Is it possible to wrap text around an image? Here is a link of what I would like to do with Flex, not HTML as in the example. Will it be possible to use the textFlow component like we tried here?
<s:TextArea width="100%" height="100%" editable="false">
<s:textFlow>
<s:TextFlow>
[code]....
View 1 Replies
Jan 21, 2010
What I have so far is all my menu items get added to an array and they have a start y property. They are all evenly placed apart.I'm taking this is little steps so as a start I wanted to click on a menu item and just move it to the center of the menu and reposition the others.I have the mid point stored.So when I click the item I find out what index in the array the item is at and I find how many index positions away the item with the start y I want to move to is.I then go through every item in the array and tell it to look that many positions away, get the startY of the item there, and set it as its destination Y. In theory it seems sound to me but it completey does not work.the code I have so far is like this
Code:
private function rearrangeStartY($menuitem:MenuItem):void
{
[code]........
View 1 Replies
Sep 20, 2006
I've got a infinite scroller (adjusted one of scotty's) and it's not wrapping around i.e there's a gap in the images, the last image kinda blinks at a certain point.I've attached the files, it's probably something quite simple but i cant see it.Here's the script:
Code:
spacing = 0;
containerMC._alpha = 100;
[code]......
View 14 Replies
Mar 10, 2008
I'm trying to load text within a shape on the stage. The shape is a square with the left and right sides concaved. )( ...I'm not sure how to go about this...my text is loading externally from a .txt file, making me think that this is not possible.
View 1 Replies
Jul 18, 2008
how to make text wrap in a combobox but now my links aren't working and I can't figure out what to do next. I know the problem is in my eventlistener.
The full instructions for how to do this Multiline combobox are available here. [URL]
//my code for the combobox page starts here
import mx.transitions.*;
import mx.transitions.easing.*;
[Code]....
View 1 Replies
Dec 24, 2009
My sample is below. How do I code the below to have the text in the qoutes, wrap?
<item text = "Action Scripting Drag and Drop Ten Minute Tutorial" url = "" url_self = "1" />
</item>
View 1 Replies
Jun 16, 2011
Can I create a custom text box shape? Or parhaps create two text boxes and link them together so the text flows from the first to the second?
Or is there another way of doing it I haven't thought of?
I'm using CS5 on a mac.
View 5 Replies
Aug 27, 2004
Ive got a dynamic text box that loads different strings into it under the msgText var right, but the text is like 3 lines long sumtimes. So how can i implement sort of a word wrap kinda thing.
View 2 Replies
Nov 10, 2006
How do I disable text wraping around an image? Just to normally write under an <img> with a single <br> (not more) in a htmlText? I wanna get rid of auto text wrapping...
View 1 Replies
Feb 5, 2011
i have a straight, gradient line which extends from one end of the screen to the other.
what is the best (or only) approach for screen wrapping this line graphic, so that it appears to be moving?
my current "solution" is to draw the horizontal line at double the width of the screen and duplicate the gradient pattern for each half of the line. the line is center-registered and it's moved toward the right. once half of the line traverses the stage, the line is reset to it's starting point.
View 2 Replies
Jun 9, 2011
Is it possible to wrap a variable-length-arguments function in Actionscript?[code]but it didn't work since sprintf was called with just 1 extra argument, i.e. the Array args.
View 2 Replies
Mar 21, 2007
Hey guys is there anyway to turn wrapping off on images in html text fields?
View 2 Replies
Aug 27, 2004
I've got a dynamic text box that loads different strings into it under the msgText var right, but the text is like 3 lines long sumtimes. So how can I implement sort of a word wrap kinda thing.
View 2 Replies
Mar 29, 2011
I have a time line of 500 points. On a timeline that wraps around how do I find if the shortest distance between two points is to go forward or backward? Example,I'm on frame 30, the target frame is 100 and the total frames are 500. I know that going it will take 70 frames to get to 100 going forward and 430 to go in reverse but I don't know the codes to figure this out. I'm using ActionScript but I think I would understand the codes if it were written in other professional languages like JavaScript.
View 1 Replies
Oct 19, 2011
When using an mx:Canvas from the Flex api inside a Sprite, I'm getting a TypeError: Error #1009 and following stack:
> StyleManager/getStyleManager
> StyleProtoChain/getStyleManager
> StyleProtoChain/initProtoChain
[code].....
View 1 Replies