IonicWind Software

Aurora Compiler => 3D Graphics => Topic started by: J B Wood (Zumwalt) on July 29, 2006, 05:01:03 PM

Title: 2D on 3D
Post by: J B Wood (Zumwalt) on July 29, 2006, 05:01:03 PM
Ok, don't know if this is doable yet, and probably not, but, how do I add a 2d object to the 3d world in this engine?
Do I just create a flat plane, add a graphic to it, place it as a child to the camera and wala?
I am going to try that and hopefully get somewhere.
Title: Re: 2D on 3D
Post by: J B Wood (Zumwalt) on July 29, 2006, 05:11:53 PM
Ok, the Camera needs an AddChild method also, so we can attach a HUD to the face of the camera, like a lense per say.
Title: Re: 2D on 3D
Post by: Ionic Wind Support Team on July 29, 2006, 08:30:08 PM
Cameras don't have children.  You can have multiple cameras though.
Title: Re: 2D on 3D
Post by: J B Wood (Zumwalt) on July 29, 2006, 09:30:00 PM
How would I place a flat plane or a flat mesh with a transparent png on it, to be 100% in the field of view of the camera?
It has to be attached to the camera so that I do not have to recalculate its location and move it around.
This would be used for many things, like a menu system, HUD, in game menu's, panels, etc.
Title: Re: 2D on 3D
Post by: Ionic Wind Support Team on July 29, 2006, 10:29:59 PM
Sprites will be in the next update so you could use one of them.  The camera supports both perspective and orthogonal modes (cam->SetMode(0) for orthogonal).  Which can be used for HUD displays.

I can also add a billboard class.
Title: Re: 2D on 3D
Post by: kryton9 on July 29, 2006, 10:40:30 PM
Paul, I know Zumwalt and I can keep asking you for tons of stuff for 3d. But keep plugging away on development, we appreciate all the bones you are throwing our way!! But I can say that we will bark for more when all is said and done :)

Having a blast with what we got so far :)
Title: Re: 2D on 3D
Post by: J B Wood (Zumwalt) on July 29, 2006, 10:47:03 PM
*drools* billboard class!
Yea what Kryton9 says, we'll keep you on your toes with reqeusts, mine are more in sync with the order that I am developing my application.
I didn't know I can layer 2 different rendering windows on top of each other and one be transparent into the other.
I'll have to give that a try, remember slow and steady wins the race :)
I'll keep plugging away at my demo for you.
Title: Re: 2D on 3D
Post by: Ionic Wind Support Team on August 07, 2006, 12:51:33 AM
OK the 3DSprite class now does something.  As illustrated by the screenshot.
;)

500 cave people running around with a 3D object in the background, on an 800Mhz it's not bad.  Still a small bug in the engine that I'm determined to track down. Then we will have a Rev 8 release.
Title: Re: 2D on 3D
Post by: kryton9 on August 07, 2006, 08:47:07 AM
Great, sounds like it will be lots of fun to play with for sure ! 
Title: Re: 2D on 3D
Post by: J B Wood (Zumwalt) on August 08, 2006, 07:55:44 PM
Hey Paul, can we get the code to that?
I am using the new font class in 8, and have ran into an interesting snag, well not a snag, it makes sense, so I want to make a sprite to do what I am doing with the font.
Title: Re: 2D on 3D
Post by: Ionic Wind Support Team on August 08, 2006, 07:59:27 PM
The sprite class is in 8.  What code are you looking for?  The example program is in you examples folder under 'd3d'.
Title: Re: 2D on 3D
Post by: J B Wood (Zumwalt) on August 08, 2006, 08:27:30 PM
I'll take a look, all I want to do is get the dimensions for the sprite to fit the screen.
I have an 800 x 600 image and an 1024x768 image that is PNG with transparency that I want to overlay.
Been a busy week at a clients site :(
Title: Re: 2D on 3D
Post by: J B Wood (Zumwalt) on August 08, 2006, 08:54:46 PM
Paul, does your sprite class have collision detection?
Title: Re: 2D on 3D
Post by: kryton9 on August 08, 2006, 09:02:34 PM
Looking in the help it is not derived from the object class which has collision and looking at the sprite methods, I don't see anything, but sure it will come.
Title: Re: 2D on 3D
Post by: Ionic Wind Support Team on August 08, 2006, 09:18:37 PM
Sprites are a 2D element so can't use the mesh collisions, nor are they affected by the camera or perspective.

We will have collision testing soon though, similar to the implimentation in the 2D library.  You can, of course, do a simple rectangle overlap test if you want.

There will have to be 3 types of collision testing routines for 3D sprites.  Rectangle overlap, color keyed, and alpha channel.  Which makes sense since your sprite can either use a transparency color key when loading, or use the alpha values from the texture image.  So a "pixel perfect" hit mask has to take into account the alpha value of each pixel.
Title: Re: 2D on 3D
Post by: J B Wood (Zumwalt) on August 08, 2006, 09:24:31 PM
Works for me, I can wait, I had a brain storm sitting at my hotel room, best I just go to bed :)