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
3 registered members (kzhao, AndrewAMD, bigsmack), 824 guests, and 5 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
find distance to closest object #247570
01/21/09 16:53
01/21/09 16:53
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline OP
Senior Member
Jaxas  Offline OP
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
Hi, does somebody know how to get distance between camera point and where you look (in fps)? or how to get point where you look.


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: find distance to closest object [Re: Jaxas] #247588
01/21/09 18:08
01/21/09 18:08
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline OP
Senior Member
Jaxas  Offline OP
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
solve it, if somebody interested here's c_trace "to" vector:
(camera.x+1000* cos (camera.pan),camera.y+1000* sin (camera.pan),camera.z+1000* sin (camera.tilt))


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: find distance to closest object [Re: Jaxas] #247676
01/22/09 03:46
01/22/09 03:46
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline
Expert
Locoweed  Offline
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Originally Posted By: Jaxas
solve it, if somebody interested here's c_trace "to" vector:
(camera.x+1000* cos (camera.pan),camera.y+1000* sin (camera.pan),camera.z+1000* sin (camera.tilt))


That doesn't account for camera.tilt though, for that do something like:

Code:

        vTemp.x	=	1000;
	vTemp.y	=	0;
	vTemp.z	=	0;
	
	vec_rotate(vTemp,camera.pan);
	vec_add(vTemp,camera.x);
	trace_mode	=	IGNORE_PASSABLE | IGNORE_PASSENTS | IGNORE_ME | IGNORE_SPRITES;
	distance = c_trace(camera.x,vTemp,trace_mode);



Professional A8.30
Spoils of War - East Coast Games
Re: find distance to closest object [Re: Jaxas] #247734
01/22/09 10:20
01/22/09 10:20
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline OP
Senior Member
Jaxas  Offline OP
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
thanks, your code also work for me wink


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)

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