Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How to draw a line from point x,y,z to x2,y2,z2 , ie. DrawLine() but for 3D ????

Author
Message
leemr
5
Years of Service
User Offline
Joined: 28th Nov 2018
Location:
Posted: 11th Dec 2018 09:27
I'm basically trying to debug a raycasting issue that's fairly demanding in terms of performance (I'm trying to make some ants avoid eachother, there are thousands), but to be honest I can't really tell whether the rays shoot in the right direction, change when the angle of the ant is changing and so on. So I'd like to draw some kind of line to see where the ray tracing goes.

Any ideas, tips or tricks people want to share??

Also, I did notice raycasting loves to return the very object it spawned from. I feel AGK2 really needs some kind of flag to always ignore the object where tracing started. I know I can check the HitID and ignore the first object that way, but to me it always came across a bit weird it doesn't ignore that when the idea is 'collision check with another object' and virtually never itself, right?.
puzzler2018
User Banned
Posted: 11th Dec 2018 12:39 Edited at: 11th Dec 2018 12:39
I thought I was seeing double - but then I dont remember not having a drink last night...


Phemox asked about similar thing

https://forum.thegamecreators.com/thread/223376
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2018 19:18 Edited at: 11th Dec 2018 19:20
GetScreenXFrom3D() and GetScreenYFrom3D() give you the 2D cordinates. Then use DrawLine()
You could turn off the collision mode for the object SetObjectCollisionMode( objID, mode ) as well

Login to post a reply

Server time is: 2024-04-25 09:22:45
Your offset time is: 2024-04-25 09:22:45