2D drawing functions vs. 3D billboards
-
- Posts: 69
- Joined: Sun Oct 12, 2003 3:42 pm
- Location: Germany
2D drawing functions vs. 3D billboards
I'm planning to do a HUD for my little shooter game which you can find here : http://www.eve-corp.com/Raptor and I was wondering whether to use the 2D drawing functions offered by the driver interface or the scene-managers billboard functions.
Also, I was wondering about generals pros & cons of the 2D drawing functions.
thx in advance
Also, I was wondering about generals pros & cons of the 2D drawing functions.
thx in advance
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
I had the same problem with my crosshair. reducing the size of the bitmap helped. (sounds like a bug to me)
Also, does anyone know how to get the 2d screen co-ordinate of a 3d position?
I want my crosshair to be like
in 3d, but to be drawn with 2d functions so that it is always visible.
(or using a billboard that remains visible, if possible)
Also, does anyone know how to get the 2d screen co-ordinate of a 3d position?
I want my crosshair to be like
Code: Select all
y
|
----+---z
|
ship ------------- crosshair
(or using a billboard that remains visible, if possible)
-
- Posts: 69
- Joined: Sun Oct 12, 2003 3:42 pm
- Location: Germany
the specks around the crosshair seem to be a result of bi-linear filtering. Turn it off, and the specks will disappear.
Concerning the coordination translation : There is a function pair which is able to convert screen coordinates to world coordinates and vice versa. I just forgot the name, sorry
Maybe it's somewhere in the camera classes ...
Concerning the coordination translation : There is a function pair which is able to convert screen coordinates to world coordinates and vice versa. I just forgot the name, sorry
Maybe it's somewhere in the camera classes ...
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
I don't think mine were from bilinear filtering, the specks were inside the transparent area of my crosshair which was black in the crosshair jpeg. No matter how many times I went back and blacked out my crosshair pic, they were still there in the same places each time I ran the game. I tested it on a bunch of computers too with all different kinds of video cards and had the same results each time. The only fix was to make the crosshair pic smaller for some reason. Strangely enough, this is the only pic thats had this problem in my game as I have loaded many others into the game without any problem. Like the cockpit, which covers the whole screen and has blacked out windows.
This one?
Code: Select all
virtual core::position2d<s32> irr::scene::ISceneCollisionManager::getScreenCoordinatesFrom3DPosition ( core::vector3df pos,
ICameraSceneNode * camera = 0
) [pure virtual]
Calculates 2d screen position from a 3d position.
Parameters:
pos: 3D position in world space to be transformed into 2d.
camera: Camera to be used. If null, the currently active camera is used.
Returns:
Returns the 2d screen coordinates which a object in the 3d world would have if it would be rendered to the screen. If the 3d position is behind the camera, it is set to (-10000,-10000). In most cases you can ignore this fact, because if you use this method for drawing a decorator over a 3d object, it will be clipped by the screen borders
Crud, how do I do this again?
-
- Posts: 69
- Joined: Sun Oct 12, 2003 3:42 pm
- Location: Germany
the 2D drawing function seem to lack the alpha-blending feature somehow. Is that possible ? I tried to load a 32bit un-compressed TGA, but it wont show up if I set the "useAlphaFromFile" bool to true.
And makeColorKeyTexture(..) doesn't do anything but convert my transparent color ( pink ) into pure black. Doesn't make much sense for me. Anybody has an idea ?
And makeColorKeyTexture(..) doesn't do anything but convert my transparent color ( pink ) into pure black. Doesn't make much sense for me. Anybody has an idea ?
-
- Posts: 69
- Joined: Sun Oct 12, 2003 3:42 pm
- Location: Germany
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
@IsoGod regarding your color keyin problem:
Do you use the DirectX driver? Afaik that's the way the ColorKey function works in DX. At least the DX9 SDK mentions this. Don't know about DX8 or OpenGl. So if Irrlicht just uses the DX function that would explain why the color keying function does... er... what it does
Btw, I'm not sure if the function affects the alpha channel in any way (given the selected display mode supports an alpha channel)
squonk
Do you use the DirectX driver? Afaik that's the way the ColorKey function works in DX. At least the DX9 SDK mentions this. Don't know about DX8 or OpenGl. So if Irrlicht just uses the DX function that would explain why the color keying function does... er... what it does
Btw, I'm not sure if the function affects the alpha channel in any way (given the selected display mode supports an alpha channel)
squonk