I got four spheres...and alignment probs!

Blitz3D Forums/Blitz3D Programming/I got four spheres...and alignment probs!

PsychicParrot(Posted 2005) [#1]
Hello all!

I need help (yeah, I know!)

I got four spheres I'm trying to align to a terrain. I guess that line picking will be quicker than using collisions on a complex mesh (??) so I'm trying to linepick 'em .. problem is that all four spheres sit at the same height, even though I'm trying to pick down from each one :S

BTW: The spheres are children of my spaceship (now thats a strange thing to write .. I'm sounding like a cult leader!) which is why I'm using PickedNY instead of PickedY ..

Heres what I got for the align bit ..



Any clues? I can't see what I'm doin wrong :(

Thanks!

Parrot


DJWoodgate(Posted 2005) [#2]
Maybe...
q=LinePick(EntityX#(c\FL,1),EntityY#(c\FL,1)+1,EntityZ#(c\FL,1),0,-5,0)
PositionEntity c\FL,EntityX#(c\fl,1),PickedY#(),EntityZ#(c\fl,1),True


Rook Zimbabwe(Posted 2005) [#3]
Children are at the mercy of their parents. Well I meant that i the Blitz3D way... At least that is what I have been told. I may have it wrong but if they are not children of the spaceship but individuals then you will have it...

Of course it cold be the variable assignment:

q1=LinePick(EntityX#(c\FL),EntityY#(c\FL)+1,EntityZ#(c\FL),0,-5,0) 
PositionEntity c\FL,EntityX#(c\fl),PickedNY#(),EntityZ#(c\fl)

q2=LinePick(EntityX#(c\FR),EntityY#(c\FR)+1,EntityZ#(c\FR),0,-5,0) 
PositionEntity c\Fr,EntityX#(c\fr),PickedNY#(),EntityZ#(c\fr)
		
q3=LinePick(EntityX#(c\RL),EntityY#(c\RL)+1,EntityZ#(c\RL),0,-5,0) 
PositionEntity c\rL,EntityX#(c\rl),PickedNY#(),EntityZ#(c\rl)
		
q4=LinePick(EntityX#(c\RR),EntityY#(c\RR)+1,EntityZ#(c\RR),0,-5,0) 
PositionEntity c\rr,EntityX#(c\rr),PickedNY#(),EntityZ#(c\rr)


There is probably a way NOT to make that happen while keeping them children of the speceship... I just don't know it.

-RZ


PsychicParrot(Posted 2005) [#4]
Thanks for the replies, guys .. still no go I'm afraid :(

I appreciate your time though :)


Stevie G(Posted 2005) [#5]
Why on earth would you position the child at the Y component of the picked normal ... doesn't make any sense to me?!

DJ Woodgate's solution should work for you ... you need to make sure your using global coords for entity positioning and reference to entityx(), entityy() etc..

Post some more code and I'm sure we can get it working for you.


Damien Sturdy(Posted 2005) [#6]
PP, youre misunderstand the NY command? Collisions are plenty fast most of the time, depends on your mesh. QUad2 had everything collidable and it ran smoooooth :P It was also making the car body float above spheres. :p

give it a go, at least? :)