Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, howardR), 472 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
view_check and frustum #451880
05/25/15 09:16
05/25/15 09:16
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
is it possible to have view_check limited to only pan angles , what I mean is I have the position and bound extends of entities and I need to only use those (fully visible) within the frustum , so I use the center points on a view_check for the camera , it works great and saves me un needed iterations in my project , but I need the view_check to disregard tilt angles such that no matter what camera tilt is that my points wil always be visible ,only their x and y position will be changing within the frustum and pan angles will then determine if those positions are in frustum ,is that possible ?

I have tried rotating the positions so that no matter the tilt angle ,the positions should stay visible in front of the frustum , but I think I messed up with their pan angles , I will check again .

any other advice on checking for x and y in the frustum and keeping the z visible ?


Last edited by Wjbender; 05/25/15 09:17.

Compulsive compiler
Re: view_check and frustum [Re: Wjbender] #451885
05/25/15 09:39
05/25/15 09:39
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You can write a view_check function yourself using vec_dot, planes and normals.

Assume you have the normal of a plane (read: one side of the view frustum) pointing outside, then check
d = vec_dot(pos,normal) - vec_dot(camera.x,normal);
for all bounding box vertices/ their positions "pos". If d is negative for one of them, repeat the same process with the other 3 relevant view frustum planes. If one of the d values is negative for all 4 planes, the entity's bounding box intersects the view frustum.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

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