www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: MegasXLS on August 27, 2010, 02:40:59 pm

Title: How load "images" in the window?
Post by: MegasXLS on August 27, 2010, 02:40:59 pm
Hi guys, i'm begginer in JPCT so....

how i load images in window of my application? The images are load with my application 3D for the user interact with the images for my application response this interact.

thx
Title: Re: How load "images" in the window?
Post by: EgonOlsen on August 27, 2010, 08:38:59 pm
??? Sorry, i don't get this question  ???
Title: Re: How load "images" in the window?
Post by: MegasXLS on August 31, 2010, 02:46:30 pm
How do I load images in my FrameBuffer to show by example the image of my character in my application?
Title: Re: How load "images" in the window?
Post by: MegasXLS on August 31, 2010, 03:25:18 pm
I tried to insert a picture in the advanced example of JPCT that exists on the site. But I can not upload any images. I also noticed that in that case I do not have a frame starts before, but the framebuffer. He wanted to know how to load an image in advanced example of the site.

Thank you in advance.
Title: Re: How load "images" in the window?
Post by: EgonOlsen on August 31, 2010, 08:10:14 pm
So...i guess you want to display some bitmaps then? In that case, load them as textures (watch the size. They have to have a power of 2 in width and height) and use the blit()-methods in FrameBuffer to display them (or parts of them).
Title: Re: How load "images" in the window?
Post by: MegasXLS on September 14, 2010, 02:42:20 pm
Hi Guys,
So...

I am not able to load the image in the buffer yet.

buffer.blit (TextureManager.getInstance (). getTexture ("tela"), 0, 0, 0, 0, 512, 512, backward);

I'm calling this statement in gameLoop () after the buffer.update ();

Where "tela" is the image of credits that were in the game robombs egon (Just for testing, congratulations on very nice game)

tm.addTexture ("screen", new Texture ("example / credits.png"));

Thanks in advance
Title: Re: How load "images" in the window?
Post by: EgonOlsen on September 14, 2010, 08:45:17 pm
Why are you refering to the texture as "tela" when it actually has been added as "screen"? Or is this hust a copy and paste error in the you've posted.... ???
Title: Re: How load "images" in the window?
Post by: MegasXLS on September 17, 2010, 02:44:11 pm
Is just error in my copy. But the two have the same name.
Title: Re: How load "images" in the window?
Post by: MegasXLS on September 17, 2010, 03:37:17 pm
I managed to load the image Egon (sorry for bad english) I put the statement before the buffer.update () inside my gameloop and everything went right.

Building on the topic,

does anyone know a way to upload a video (in mp4 or other format) into a 3D object into an application using JPCT? My application needs to do a video (any format) run on a TV screen that is loaded in my application. = /

Thank you in advance
Title: Re: How load "images" in the window?
Post by: paulscode on September 17, 2010, 09:58:55 pm
If you are able to use some 3rd-party library to capture the video frames into instances of java.awt.Image, you can use a texture effect implementation and java.awt.image.PixelGrabber to create a "video texture".  One way is with JMF, as I did in this thread (http://www.jpct.net/forum2/index.php/topic,1424.0.html) and this one (http://www.jpct.net/forum2/index.php/topic,1431.0.html).  JMF doesn't work on the Android, though, so if you need this for a jPCT-AE project, you'll need something else.  I am currently looking into the possibility of grabbing frames from a MediaPlayer into Bitmap instances to either be used in a texture effect or swapping out a Texture (no idea how fast this will would work on a phone, though).