Here is an approach that I have used.

Your environment will be 3D tiles and you will be looking down at a given
angle upon your map.  Buildings will be 3D.

But items such as trees/lamps/grass/etc.. are non animated 2D billboard
objects.

Create billboard objects for your 2D sprites.  You will need to store your
animations in one(or more) textures.  What you need to create is a method to
cycle through the frames.  This can be done by applying multiple textures
for each frame(highly inefficent), or what I would recommend is to use the
fewer textures per sprite and sub section the textures for each frame.  Then
what you are essentially doing is updating the texture coordinates between
frames.  I go to the next frame during the AnimBehavior class.

Each Animated Object, I have a series UV coordinates for a texture that
define the frames within an animation.  As you cycle through the series and
update your UV coordinates you get your animated 2D sprite effect.

For Characters you need to determine which way they are facing.  This will
determine which angle you are animating as you rotate around the character.
You most likely have 4 or more equivalent animation variations.  Two for if
you are at the front right or left of a character and two for right and back
of the character.

Hope this helps.




-----Original Message-----
From: Nicholas Pappas [mailto:[EMAIL PROTECTED]
Sent: Monday, November 22, 2004 12:07 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Drawing 2D Graphics on Canvas3D -- with collision
detection


Hello all!

I am currently working on a small game engine to create a 3D tile map w/
2D sprites on top.

My first issue is getting the 2D sprites on the Canvas3D (the seamingly
holy grail). I have found code for one solution by overloading the
postRender() function in Canvas3D. This works for simple static
graphics, but I will have many 2D sprites moving about -- likely without
the user interacting with the 3D space at times. So I'm not sure that
the postRender() overload is a viable solution for me.

After the Canvas3D has loaded, how can I display 2D sprites which can
animate and move over the map in the most effective way?

My second problem is, once I have the first solved, I need to handle
collision detection between these 2D sprites and the 3D map. Does anyone
have any suggestions on how I can handle this detection between the two
graphic types?

Thank you so much for any help!!

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to