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 - Nodin

Pages: [1]
1
Support / Re: How best to do animated sprites
« on: June 30, 2010, 06:43:28 am »
Thanks, That did the trick.  :D 

I created an animation object with just one keyframe of the sprite's mesh, then set the animationSequence for the sprite, and all is well now with updating the UVs on the fly. 




 

2
Support / Re: How best to do animated sprites
« on: June 29, 2010, 03:22:20 am »
Thanks for your help.  Unfortunately that didn't do the trick.  Here's what I'm basically doing in onDrawFrame, hopefully it's enough for some insight;

               sprite.build(false); //called much earlier outside of onDrawFrame

               //inside onDrawFrame
      quadUVs = animationTexture.getCurrentQuadUVs(); //my own class, the UVs come back correct every frame
      tex1 = new TextureInfo(
                TextureManager.getInstance().getTextureID( "spritetex" ),
                quadUVs.u1, quadUVs.v1, quadUVs.u2, quadUVs.v2,
                quadUVs.u4, quadUVs.v4 );
        tex2 = new TextureInfo(
                TextureManager.getInstance().getTextureID( "spritetex" ),
                quadUVs.u2, quadUVs.v2, quadUVs.u3, quadUVs.v3,
                quadUVs.u4, quadUVs.v4 );
        sprite.getPolygonManager().setPolygonTexture( polyIdOffset,
                                                    tex1 );
      sprite.getPolygonManager().setPolygonTexture( polyIdOffset + 1,
                                                    tex2 );

      sprite.touch();

...I only ever see the first frame, unless I forcibly skip it, then I see the second.  I know the screen is updating as I can see a framerate blit I have going.

3
Support / Re: How best to do animated sprites
« on: June 27, 2010, 12:09:55 am »
After a bit of work, I'm in the same boat, although it doesn't work for me in the emulator either.  I can change the UVs for a texture on the fly and it doesn't change on display.  Are we missing some kind of flush function call?

4
Support / How best to do animated sprites
« on: June 17, 2010, 11:01:00 pm »
Hi All,

I'm having a hard time figuring out how to do animated sprites efficiently (and easily!).  Is there a single best way?  Let's say I need hundreds of them animating on the screen at once.  Swapping textures around certainly doesn't seem the best way,...can I change UV coordinates on the fly?

Thanks!

5
Support / Re: How to do 2D click to 3D object picking?
« on: June 12, 2010, 05:08:04 pm »
Thanks, it was the collision check setting!

Cloned objects don't have the setting of the original.

6
Support / Re: How to do 2D click to 3D object picking?
« on: June 11, 2010, 07:52:44 pm »
Thanks, I did finally get a touch point to project a ray into the world, but I can't pick an object.

Using calcMinDistanceAndObject3D always returns empty, even when I can see my ray hitting an object.

Object[] result = getWorld().calcMinDistanceAndObject3D(camera.getPosition(), ray, 10000F);

result[0] always has a float
result[1] is always null

Any ideas?

7
Support / How to do 2D click to 3D object picking?
« on: June 11, 2010, 05:10:05 am »
How can I take a touch event on the display and project it into world coordinates and pick a world object?

Previously using jPCT I had success using the object ids with something like;

SimpleVector position=new SimpleVector(Interact2D.reproject2D3D(camera, buffer, x, y));
int[] res=Interact2D.pickPolygon(theWorld.getVisibilityList(), position);

..but that's not supported in jPCT-AE?

Thanks!

8
I've discovered my graphic was also messed up, and switched to png with no problems.


9
setTransparency(0) seems to do the trick for hw rendering at least,...

10
I've started making dialogs with overlays.  Is there something I'm missing about using transparency with overlays?  I can't seem to make it happen in hw/sw modes.  Transparent textures in 3Dobjects do work fine...

Basically, I'm just creating the texture with something like;

Texture texture = new Texture(image,useAlpha);

and I've tried adding textureInfo to the effect of;

ti.add(textureID,TextureInfo.MODE_ADD);

For the moment I'm manually tracking overlay depth(z-order) while testing, and everything is 1f apart.  (I will make a depthmananger soon...)

My efforts so far give me overlays, but they all seem to jiggle on the screen x-axis abit, and transparency isn't working.

Tips appreciated!


11
Thanks!  I need to look at overlays. I have been experimenting with having the option of both hardware or software rendering, so I've been looking at a solution for both for general menus.  I found a very cool demo that blits invisible swing components to the screen, and preserves their mouse events, but it doesn't seem readily adaptable. (Google swingle)  I did try getting it to blit a texture, but I'm not too good with bytebuffers...  It could be pretty cool to be able to blit a swing component to a texture.  It would open up use of all swing components.

It would be great to have some kind of menu library that can handle all sorts of things like dialogs, windows and chat boxes ect...it seems fengui isn't out there anymore.




12
Thanks!   What do you mean when you say overlay?  Do you mean creating and displaying an image and then detecting mouse clicks on it in specific areas?

13
Hi All,

I'm wondering, what's the best approach for programming dialogs and menus to use with jPCT in webstart apps?  I'd like to be able to use a custom skin and use transparency... modal and non-modal,...

Thanks!


Pages: [1]