CameraViewPort Origin
Blitz3D Forums/Blitz3D Beginners Area/CameraViewPort Origin
| ||
Is it possible to change this from the standard origin from straight in the middle of the viewport for Blitz3d?? I'm using :- graphics3d 640,480 .. CameraViewport camera,0,0,480,480 CameraViewport hud,480,0,160,480 What I want is for the hud to be displayed over the top of the main view using - CameraClsMode camera(2),False,True The origin of 'camera' is 240,240 but I want to extend the main viewport to fill the whole screen so that the hud is actually covering something but still retain a 240,240 origin. I need this for zooms etc.. If someone out there has a clue what I'm on about can you help? |
| ||
Can't you just change your viewport to a negative value in the x direction. I thought I did something like this once. So your viewport for 'camera' would be -160, 0, 800, 480 Blitz automatically clips all drawing operations to the screen. This might affect framerate though... |
| ||
why not jut parent all your hud entity's to the camera, so basically wherever the camera goes, the hud stays in its place. Or just use sprites? |
| ||
I think what he is trying to say is that he wants the CENTER of the view seen by the camera, OFF-CENTER from the viewport BUT he also wants whats drawn to still fill the entire screen. |
| ||
WolRon - that's exactly what I need but using a negative value for x direction doesn't do what you'd expect - everything just flickers in that viewport and the origin that the camera is pointing to doesn't change - it just freezes. The problem really is nothing to do with the hud as this is easy to implement. |
| ||
that can't be done i don't think. When renderworld is called it fills the entire screen, so if you offset the viewport then you will have a black line. Only thing i can think of is to move the camera back a bit, renderworld, then copy to a texture, then render the texture to the screen. I still don't get why you would need to offset the centre. The centre should be the bit the eye looks at, so if you have a hud covering the top of the screen, then your eye should adjust it's self to the centre of the playscreen |
| ||
I still don't get why you would need to offset the centre. The centre should be the bit the eye looks at, so if you have a hud covering the top of the screen, then your eye should adjust it's self to the centre of the playscreen In his first post, he stated that the HUD was on the right (CameraViewport hud,480,0,160,480) so if his viewport is set to the entire screen coordinates then the 'center' would be off-center from the area that the HUD doesn't cover. I think this works two ways. If your 'HUD' is actually a bitmap that covers everything on the right then you would want to offset the center as Stevie asked (which actually wouldn't be a problem, just set the viewport accordingly). But if your HUD is ACTUALLY a HUD (Heads Up Display) and only covers up some parts of the main image, then I think the center of the 'view' should be in the center of the screen as joker stated (which means that what Stevie is trying to do might be pointless and feel 'wrong'). |
| ||
I'll try to explain my reasons. I have a contant overhead view so the camera is pointing directly down and chases the controlled object on the x & z axis only. On a 640,480 viewport you can see more of the level on the left and right hand side and up and down. By using a square viewport the player is able to have an equal field of vision left/right, up/down constant field of vision. Using a 640,480 viewport some of the right hand side of the view would be obscured by the hud I plan to overlay on top. If I can somehow set the origin of a 640,480 viewport to be 240,240 the hud will not obscure part of the view to the right. I know I could do this by positioning a 480x480 view port directly in the middle of the screen and have the hud objects covering the spare left and right parts of the screen but as all the parts of the hud are connected it looks better to have the whole hud on one side of the screen. I'm assuming I can't do it like this :- /---------/--\ |...***......| |..*...*...H.| |..*.<.*...U.| |..*...*...D.| |...***......| \---------\--/ If player moves to the left you see this /---------/--\ |........***.| |.......*..H*| |...<...*..U*| |.......*..D*| |........***.| \---------\--/ |