Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 1,151 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
2d and 3d coordinate problem #285897
08/21/09 10:29
08/21/09 10:29
Joined: Jun 2009
Posts: 17
Cebu Philippines
U
uone Offline OP
Newbie
uone  Offline OP
Newbie
U

Joined: Jun 2009
Posts: 17
Cebu Philippines
Hello Guys,

I having a problem here on how to make my 2d object to have the same coordinate to another 3d object, i mean i am creating a 3d game but i want to create a 3d object that is invisible and on top of it will be a panel bitmap object, my problem is i cant get the 2d or 3d object in the same coordinate while moving.
Some advice place..

Re: 2d and 3d coordinate problem [Re: uone] #285899
08/21/09 11:14
08/21/09 11:14
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Is the 2D object a PANEL*? You should use a sprite instead, because you can position and rotate them in 3D space.

Create your sprite, set whatever angles you want and then use vec_set in a loop to place it above your 3D entity.

Re: 2d and 3d coordinate problem [Re: DJBMASTER] #285900
08/21/09 11:24
08/21/09 11:24
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
You can use vec_to_screen to convert the coordinates of the object to screen-space laugh

Re: 2d and 3d coordinate problem [Re: Claus_N] #285919
08/21/09 15:25
08/21/09 15:25
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
other possibilties:
place a new VIEW under the bmap,
or use ent_createlayer, to place the item directly onto the screen

Re: 2d and 3d coordinate problem [Re: MrGuest] #287702
09/02/09 08:02
09/02/09 08:02
Joined: Jun 2009
Posts: 17
Cebu Philippines
U
uone Offline OP
Newbie
uone  Offline OP
Newbie
U

Joined: Jun 2009
Posts: 17
Cebu Philippines
thanks for the answers guys,

i used vec_to_screen function but the panels did not display on the coordinate of the entity i specified.
below is my code:


vec_set (temp_pos, my.x); // copy the xyz coordinates of the entity to temp_pos
vec_to_screen (temp_pos, camera); // convert the 3D position to 2D screen coordinates
BombBrick2.pos_x = temp_pos.x; // and then set the position of the text
BombBrick2.pos_y = temp_pos.y; // on x and y
set(BombBrick2,SHOW);



please advice...

Re: 2d and 3d coordinate problem [Re: uone] #287910
09/03/09 08:17
09/03/09 08:17
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Please note that panels use their top left coordinate instead of the middle coordinate.
So maybe you should subtract the coordinate with a half of bitmap_width(or something like that)...


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1