how can i make background with png or jpg image?

Software: Away3D 4.x

skahandz, Newbie
Posted: 13 August 2012 08:17 AM   Total Posts: 7

i used gold version(4.x) and load obj 3d-model

i don’t know how i make a background with my jpg file?

i was trying view.background method but can’t solve this problem

help me please and sorry my bad english

thanks

   

John Wilson, Member
Posted: 13 August 2012 10:09 AM   Total Posts: 62   [ # 1 ]

Hi,

This works for me:

[Embed(source="assets/sky/sky.jpg")]
private var Sky : Class;
.
.
.
var 
bmd:BitmapData = new Sky().bitmapData;
view.background = new BitmapTexture(bmd); 
   

skahandz, Newbie
Posted: 13 August 2012 10:31 AM   Total Posts: 7   [ # 2 ]

Thanks,

but i see a only black screen.


this is my script:

[Embed(source="/../embeds/gra.png")]
public var backImg:Class;

private function 
initEngine():void
{
 stage
.scaleMode StageScaleMode.NO_SCALE;
 
stage.align StageAlign.TOP_LEFT;
   
 
scene = new Scene3D();
  
 
camera = new Camera3D();
   
 
view = new View3D();
 
view.antiAlias 20;
 
view.scene scene;
 
view.camera camera;
 
view.rightClickMenuEnabled false;
   
  
 
//setup controller to be used on the camera
 
cameraController = new HoverController(cameranull4510800);
 
view.addSourceURL("srcview/index.html");

              
//background-image
 
var bmd:BitmapData = new backImg().bitmapData;
 
view.background = new BitmapTexture(bmd);      

              
addChild(view);
   

 
//add signature
 
Signature Sprite(new SignatureSwf());
 
SignatureBitmap = new Bitmap(new BitmapData(Signature.widthSignature.heighttrue0));
 
stage.quality StageQuality.HIGH;
 
SignatureBitmap.bitmapData.draw(Signature);
 
stage.quality StageQuality.LOW;
 
addChild(SignatureBitmap);

i just see a black screen(default background color) without my 3d-model when i run this script

what is my mistake?

   

Richard Olsson, Administrator
Posted: 13 August 2012 02:17 PM   Total Posts: 1192   [ # 3 ]

Please make sure you are using the debug player so that you would notice if there were any runtime errors. Note that like all other textures, the dimensions of the texture that you want to use as your background must be powers of two (e.g. 512x512 or 1024x1024.)

   

skahandz, Newbie
Posted: 13 August 2012 05:18 PM   Total Posts: 7   [ # 4 ]

WOW!!! Thanks very very much

i solved problem.

   

redimage, Newbie
Posted: 28 August 2013 07:51 AM   Total Posts: 3   [ # 5 ]

it is easy for us to make png or jpg image, but how to make it to be the background. this puzzles me a lot. i have install an image control c#. could anyone tell me whether it is helpful for making barcode image.

   

cindy313, Newbie
Posted: 12 November 2013 06:25 AM   Total Posts: 1   [ # 6 ]
redimage - 28 August 2013 07:51 AM

it is easy for us to make png or jpg image, but how to make it to be the background. this puzzles me a lot. i have install an image control c#. could anyone tell me whether it is helpful for making barcode image.

well, thanks for sharing first! i’m wondering whether it can be done by using imager ?

   

abbylee, Newbie
Posted: 03 April 2015 07:15 AM   Total Posts: 4   [ # 7 ]
redimage - 28 August 2013 07:51 AM

it is easy for us to make png or jpg image, but how to make it to be the background. this puzzles me a lot. i have install an image control c#. could anyone tell me whether it is helpful for making barcode image.

You means use C# to create bar code images? I’ve looked at it, the introduce seems said that it can help you make bar code images.

   

movieclip, Newbie
Posted: 13 April 2015 07:36 AM   Total Posts: 10   [ # 8 ]

Can I change UV of a background image?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X