Hello how i can get Trees and Stones.... in a Linklist ?
Hello how i can get Trees and Stones.... in a Linklist ?
Last edited by lustikus12; 11-27-2009 at 02:26 PM.
First
flr
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
Second
flr
Well, thats just some basic vector algebra.
Your orientation is the rotation to (1, 0) in radian (maybe its (0, 1), not 100% sure). Now calculate the angle between the vector (object - you) and (1, 0) (resp. (0, 1)) and from those calculate the angle between (object - you) and (you). then just decide a range where it has to be (like [pi/8, 7pi/8]) to be called "in front".
/edit:
ofc [pi/8, 7pi/8] is bullshit... [pi/8, 15pi/8] is way better.
/edit2:
holy shit, im to tired... ofc [pi/8, 15pi/8] is still bullshit, thats exactly the range where it should be to be not in front of you... so its basically if(¬({angle} ^ [pi/8, 15pi/8])) then its in front (where ^ means Intersection)
Last edited by Cromon; 11-27-2009 at 02:35 PM.
I think he's asking for the list that unknowned posted about a while back.
Yes i'am looking for the Memoryadresses that show me what is the next tree or Stone or what ever... I want to hit them ....
no, i ment pi/8 for 45°, maybe 60° would be better but greater then 60° would pretty much mean that either the model is not where we walk through or just some small distance before us. So in my opinion a cone with 60° fits it pretty well (depending on the size of the model.
@lanman: Yeah, he edited the post, before he was asking for how to dtermine if a model is in front.
But... pi/8 isn't 45° lol. Pi/4 is! With 2pi = 360°. and 1pi = 180°
]
Oh ma dear, sure, 2pi / 2 isnt pi/2. Such errors after studying math are a blame... Has to be cause of the intense kickboxtraining
/Edit:
*hopes no one sees that i accidentally posted some of my great new plan with a great new coordinatesystem where 45° are pi/8 whith wich it will be possible to verify the Riemann hypothesis*
Last edited by Cromon; 11-27-2009 at 05:11 PM.
You can close here pls
Plant a tree !
[YT]<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/CIaOedqu_ng&hl=de_DE&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/CIaOedqu_ng&hl=de_DE&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>[/YT]
Hey, it compiles! Ship it!