|
D0M41N, Newbie
Posted: 07 August 2013 07:37 PM Total Posts: 1
Hi, does somebody how to simple make a materialtexture, for a plane, from a movieclip material? my code is:
var planetexture:TextureMaterial = new TextureMaterial(planematerial); var planeGeometry:PlaneGeometry= new PlaneGeometry(totalwidth,totalheight*2,8,8,true,true); var plane:Mesh = new Mesh(planeGeometry,planetexture);
Where planematerial is the movieclip instance.
|
Indyaner, Newbie
Posted: 01 January 2014 07:19 PM Total Posts: 5
[ # 1 ]
Are there any News on this Topic?
I’ve read this request many times when I search for Movieclips+Away3D, yet there doesnt seems to be an implementation. Some say it is way to performance hungry and others say that it is a problem with Stage vs. Stage3D inside the ActionScript Virtual Machine 2 (AVM2).
In PV3D I used a MovieClipMaterial as my primary interaction Element. I really hope that this will come back to Away3D 4 (Away4) as it was in Away 3D 3.6.
Any news on that?
|
theMightyAtom, Sr. Member
Posted: 02 January 2014 09:10 AM Total Posts: 669
[ # 2 ]
You can do this, it just takes a little manual coding.
Hi Indyaner, you can do this already, with a bit of a work around.
1.Make your interactive MovieClip.
2.To use it as a material, make an instance, use bitmapData.copy, apply to BitmapMaterial. Make sure you use the same bitmapData each time, to save memory.
3. make sure your mesh has mouseEnabled and mouseDetails set to true.
4. Assign a MouseEvent3D to the mesh.
5. When you get an event, you can read the uv coordinates from the event and that gives you the point in the MovieClip where the event occurred.
You can then create you activity in AS3 based on the coordinates (think image maps in HTML)
Here’s an example using this technique, though instead of triggering interface events, it just makes a hole at that coordinate.
http://videometry.net/broomstick/RealtimeDeformation.html
Good Luck!
|
Indyaner, Newbie
Posted: 02 January 2014 02:33 PM Total Posts: 5
[ # 3 ]
Well, let me start off with thanking you for your fast reply. I’m very glad you took the time and give me a piece of your mind.
But converting a MovieClip into a BitmapMaterial, doesn’t that diminishes the whole purpose of a MovieClip-Material?
I mainly use MoviecClip in my Interfaces for Animations. Showing graphs and visualize everything that makes the human-machine communication easier. Therefore I rely on MovieClips as they can be animated. Converting a MC to a Bitmap strips all those features and I’m left with a snapshot of an animated MovieClip.
What I meant to say was: Will/Is there a possibility to use an Animated Movieclip as a Texture on a primitive?
|
theMightyAtom, Sr. Member
Posted: 02 January 2014 03:23 PM Total Posts: 669
[ # 4 ]
Yes it is, but only in the way I describe here, i.e. writing a new bitmap to the GPU each frame. MovieClips and Away3D don’t operate in the same graphic layer. Your MovieClip is CPU animated, while Away3D operates in GPU (for the most part) through Stage3D. This has many benefits for speed, but the downside is you can’t use normal displayList operations such as filters, movieClips, etc. etc. I’m sure there are deeper explanations around but the gist is, Stage3D and DisplayList are operating separately and the only way from one to the other is through bitmaps.
The same is true if you wanted to use your 3D scene as a texture in your movieCLip. You would have to grab it as a bitmapData.
I hope that helps
For better performance you can always build your interface as 3D and keep everything on the GPU. Also check out Starling API. This uses GPU for 2D, although is does this by making vector graphics into bitmaps so, same procedure!
Good Luck!
|
Indyaner, Newbie
Posted: 02 January 2014 03:25 PM Total Posts: 5
[ # 5 ]
Ah I see. I misunderstood you in your first post. I get it now.
Thank you for your input and time
(happy new year to you)
|
theMightyAtom, Sr. Member
Posted: 02 January 2014 03:30 PM Total Posts: 669
[ # 6 ]
No probs. I lobbied for a change of name, for example AwayGL 1.0 instead of Away3D 4.0.
It causes masses of confusion for those coming from earlier versions when they have NOTHING AT ALL in common. Same goes for the poor sods who buy the books and can’t get anything to work, as they were written for 3.6.
Oh well, you can always ask here
|