Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
1 registered members (AndrewAMD), 609 guests, and 3 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
model as a view... why it can't be viewed? #282094
07/30/09 11:20
07/30/09 11:20
Joined: Mar 2009
Posts: 276
Cebu City, Philippines
boyax Offline OP
Member
boyax  Offline OP
Member

Joined: Mar 2009
Posts: 276
Cebu City, Philippines
My problem is initializing the arrow model in which i can't see it...

I'm trying to put an arrow model that would point to the obstacle in my level. Hence, as i've tried to have a small test it will display.

sample output:


but, when i ported it to my game project, I can't see the arrow model? it should always be on mid-top on the screen.
I've already make sure the vector & the layer set are visible to the camera at start.

Here's some code:
Code:
function arrow_init()
{
 while(player == NULL){ wait(1); }
		
  ent_arrow = ent_createlayer("arrow.mdl", 0, 2);

  //pose and orientate it	
  if(ent_arrow  != NULL)
  {	
    vec_set(ent_arrow.x, vector(-20000,12224,16640));		
    if(NULL != vec_to_screen(ent_arrow, camera))  //just to check if it's visible
     {
	ent_arrow->tilt = 180; //see rotation code; init rotation	
     }

   }	
}




Any idea? I'm not sure if missed something. Thanks

Last edited by boyax; 07/30/09 11:22.
Re: model as a view... why it can't be viewed? [Re: boyax] #282308
07/31/09 08:47
07/31/09 08:47
Joined: Mar 2009
Posts: 276
Cebu City, Philippines
boyax Offline OP
Member
boyax  Offline OP
Member

Joined: Mar 2009
Posts: 276
Cebu City, Philippines
I'm still stucked with this... anyone?

by the way, the arrow model should be part of the view... since it will always display.

Last edited by boyax; 07/31/09 09:27.
Re: model as a view... why it can't be viewed? [Re: boyax] #282332
07/31/09 11:17
07/31/09 11:17
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
your coordinates (vector(-20000,12224,16640)) are wrong. the coordinates of a layer or view entity are relative to the camera! so your arrow must be very very far away from the camera so that its too small to see.

try something like vector (100, 0, 50)

the first value (x) is the distance to the camera,
the second one (y) is left/right
and the third one (z) is up/down

hope that helps!
- SchokoKeks

Last edited by SchokoKeks; 07/31/09 11:19.
Re: model as a view... why it can't be viewed? [Re: SchokoKeks] #282345
07/31/09 12:02
07/31/09 12:02
Joined: Mar 2009
Posts: 276
Cebu City, Philippines
boyax Offline OP
Member
boyax  Offline OP
Member

Joined: Mar 2009
Posts: 276
Cebu City, Philippines
got it! I've just knew the coordinates of the layer are relative to the camera... I haven't seen this in the manual.

Thanks for the help. smile


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