Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Yerst

Pages: [1] 2 3
1
Support / Re: Rendering on a part of the screen
« on: August 19, 2013, 01:33:32 pm »
You see the Skybox i rendered in the upper left corner, but it should be on the window at the right.
I did this now:
Code: [Select]
fb.setVirtualDimensions(width,height);
fb.setRenderTarget(preview);
fb.clear();
skyBox.render(world, fb);
world.renderScene(fb);
fb.removeRenderTarget();
fb.blit(this.submenu_background, 0, 0, 0, 0, 512, 256, width, height, -1, false);
fb.blit(this.preview, 0, 0, (int)(width/1.72), (int)(height/11), preview_width, preview_height, (int)(width/2.53) , (int)(height/1.5), -1, false);
And the skybox is gone.
The texture is where it should be, it is just black (like it wouldn't render at the texture at all.
Even if i clear it with another color, it is black...

2
Support / Re: Rendering on a part of the screen
« on: August 18, 2013, 12:38:57 pm »
To be honest, i have no idea what setVirtualDimensions does. I just set it to my screen size and it doesn't zoom in anymore.
But i have still problems with my render target. I tried rendering a skybox (just to test it) when my render target is set to my texture, but it doesn't show the result it wanted.
Code: [Select]
fb.blit(this.submenu_background, 0, 0, 0, 0, 512, 256, width, height, -1, false);
fb.setVirtualDimensions(width,height);
fb.setRenderTarget(preview);
skyBox.render(world, fb);
world.renderScene(fb);
fb.display();
fb.removeRenderTarget();
fb.blit(this.preview, 0, 0, (int)(width/1.72), (int)(height/11), preview_width, preview_height, (int)(width/2.53) , (int)(height/1.5), -1, false);
Screenshot (i think you know where it should be):

3
Support / Re: Unsupported texture width
« on: August 17, 2013, 10:25:28 pm »
You could change the name of the textures in the TextureManager to something like "RackForFlowers0", "RackForFlowers1",... and just call temp.setTexture("RackForFlowers" + Integer.toString(i));

4
Support / Re: How to do the profiling in jPCT-AE?
« on: August 17, 2013, 12:56:36 pm »
@kiffa:
Could you tell me how you got your memory profiling values?
I'm only familiar with this 3:
Code: [Select]
android.os.Debug.getNativeHeapSize()
android.os.Debug.getNativeHeapFreeSize()
android.os.Debug.getNativeHeapAllocatedSize()
How do you get values like the app memory limit?

5
Support / Re: Unsupported texture width
« on: August 17, 2013, 11:56:25 am »
You need to assign the texture to the Object.
It doesn't matter how you name the texture, it just needs to be the same name you called it in the TextureManager.
Code: [Select]
yourBallModel.setTexture("ballTexture");Or for your Current Name:
Code: [Select]
yourBallModel.setTexture("main_product_133750009413897300.jpg");

6
Support / Re: Unsupported texture width
« on: August 16, 2013, 06:16:27 pm »
Your texture sizes need to be a power of two. (2^n)
So just scale your texture to 512*512 for example, and it should work.

7
Support / Re: Rendering on a part of the screen
« on: August 16, 2013, 06:14:33 pm »
How do i switch to OpenGL ES 2.0 ?

//EDIT: Ok, i think i will just use a 128*128 Texture and scale it up to my needs.
But i have still problems with rendering the world.
When i render it after i set the render target, everything gets bigger. Looks like it would zoom in.
Code: [Select]
fb.blit(this.submenu_background, 0, 0, 0, 0, 512, 256, width, height, -1, false);
fb.blit(this.preview, 0, 0, (int)(width/1.72), (int)(height/11), preview_width, preview_height, (int)(width/2.53), (int)(height/1.5), -1, false);
fb.setRenderTarget(preview);
//world.renderScene(fb); When i enable this, everything gets bigger
fb.display();
fb.removeRenderTarget();

8
Support / Re: No success with importing 3ds into Project
« on: August 16, 2013, 12:54:16 pm »
sry, i forgot about the resources.
You need the application context to get the resources.
You can get the application Context by calling this.getApplicationContext() in your (Main)Activity.
I hand over the Context to every class where i need it, not only the Resources, because they cannont access the assets folder.
To get the Resources do the following just call
Code: [Select]
Resources res = context.getResources() in your class.

P.S.: If you didn't already know, just press Strg+Shift+O and eclipse will import everything you need.

9
Support / Re: Rendering on a part of the screen
« on: August 15, 2013, 12:42:32 pm »
So, this is the code i'm using:
Code: [Select]
fb.blit(this.submenu_background, 0, 0, 0, 0, 512, 256, width, height, -1, false);
fb.blit(this.preview, 0, 0, 300, 50, preview_width, preview_height, preview_width, preview_height, -1, false);
fb.setRenderTarget(preview);
fb.display();
fb.removeRenderTarget();
It works for a size of 512*256, but at 512*257 i get a "Can't render into a texture larger than the current framebuffer!" exception.
I tried resizing the framebuffer without success.

Where should i render the world?

10
Support / Rendering on a part of the screen
« on: August 14, 2013, 05:57:00 pm »
Hey!
Is there a way of rendering only on a part of the screen?
I have a blitted game menu and i would like to show a preview of the current selected item (in 3D) on it.

11
Support / Re: No success with importing 3ds into Project
« on: August 14, 2013, 02:47:44 pm »
This is what you need to load a .3ds file (in res/raw):

Code: [Select]
Object3D model = Object3D.mergeAll(Loader.load3DS(res.openRawResource(R.raw.model), scale));
world.addObject(model);
It it has a Texture:
Textures aren't packed in a .3ds file. You need to save the Texture (as a .png for example) and copy it in the assets or res/raw.
This should work then:
Code: [Select]
TextureManager tm = TextureManager.getInstance();
Object3D model = Object3D.mergeAll(Loader.load3DS(res.openRawResource(R.raw.model), scale));
tm.addTexture("model_texture",new Texture(res.openRawResource(R.raw.model_texture)));
model.setTexture("model_texture");
world.addObject(model);

12
Forget about this topic, i already found my fault.
It's just to embarrassing to talk about...

13
Hey!
I'm currently stuck at a weird problem.
This works and show exactly what i wan't:
Code: [Select]
else
{
fb.blit(this.background, 0, 0, 0, 0, 512, 256, width, height, -1, false);
}
But when i call this in another class it doesn't:
Code: [Select]
else
{
csssm.update(fb,this.background);
}
csssm.update():
Code: [Select]
public void update(FrameBuffer fb,Texture texture)
{
fb.blit(texture, 0, 0, 0, 0, 512, 256, width, height, -1, false);
}
There is just a blank image then...

14
Support / Re: How to effectively implement GUI with jPCT-AE?
« on: August 03, 2013, 06:17:27 pm »
@Thomas.: What were you using to do this?

15
Support / Re: How to lock translations?
« on: July 30, 2013, 11:09:55 pm »
Thx, but how do i also do this with rotations?

Pages: [1] 2 3