May 14, 2024, 12:59:54 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


2D on 3D

Started by J B Wood (Zumwalt), July 29, 2006, 05:01:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

J B Wood (Zumwalt)

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.

J B Wood (Zumwalt)

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.

Ionic Wind Support Team

Cameras don't have children.  You can have multiple cameras though.
Ionic Wind Support Team

J B Wood (Zumwalt)

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.

Ionic Wind Support Team

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.
Ionic Wind Support Team

kryton9

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 :)

J B Wood (Zumwalt)

*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.

Ionic Wind Support Team

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.
Ionic Wind Support Team

kryton9

Great, sounds like it will be lots of fun to play with for sure ! 

J B Wood (Zumwalt)

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.

Ionic Wind Support Team

The sprite class is in 8.  What code are you looking for?  The example program is in you examples folder under 'd3d'.
Ionic Wind Support Team

J B Wood (Zumwalt)

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 :(

J B Wood (Zumwalt)

Paul, does your sprite class have collision detection?

kryton9

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.

Ionic Wind Support Team

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.
Ionic Wind Support Team

J B Wood (Zumwalt)

Works for me, I can wait, I had a brain storm sitting at my hotel room, best I just go to bed :)