Programmers block

Blitz3D Forums/Blitz3D Programming/Programmers block

Shambler(Posted 2005) [#1]
How do I position a 3d object at specific 2D screen coordinates.

I know I have seen a way but I can't remember how ^^

It is for showing items in the players inventory which is a square grid on the screen.


Rob Farley(Posted 2005) [#2]
http://www.blitzbasic.com/codearcs/codearcs.php?code=321


Shambler(Posted 2005) [#3]
Cheers. ;)


jfk EO-11110(Posted 2005) [#4]
there may be a problem when youmove away or rotate the camera, then this system won't work anymore since it expects tha camera to be positioned at 0,0,0 with rotation 0,0,0. What you could try is: parent the hud stuff to the camera right after creation and show and hide it depending on its usage. All you have to do is position it relative to the parent now (so set the global/local flag to local). In theory this should work.


_PJ_(Posted 2005) [#5]
Would it be better to create a pivot, parent the pivot to the HUD, parent all the HUD stuff and position accordingly relative to the pivot, then Show/Hide the pivot so it can recursively take care of all the HUD Sprites etc. If it IS for a HUD that is?


Shambler(Posted 2005) [#6]
This is part of the HUD yes, the HUD is generated using Fontext.

It is for positioning the objects the player has picked up into their inventory slots, rather than having a bitmap representation of the object you can see the 3D object itself.

Works fine just by parenting the objects to the players camera then doing a little math on the x/y positions.

Each object type will have to have a scale so that large and small items look the same size and take up just one slot of the inventory.

No internet at home atm so I can't show you a screeny ^^