Skidmark alignment...

Blitz3D Forums/Blitz3D Programming/Skidmark alignment...

Tab(Posted 2009) [#1]
I made a skidmark system, all work fine, but i have a little problem with the alignment to the ground...



I have the X/Y/Z info from the center of the wheel (Red Point) and the X/Y/Z from were the wheel contact the ground (Green point)...

The idea is calc in some way the blue point using the X/Y/Z data and place the mark over the ground.


GfK(Posted 2009) [#2]
Something like:
Offset# = 0.9 ;skidmark height above ground (90% of wheel radius)
wheelRadius# = Abs(redY# - greenY#)
blueY# = redY# - (wheelRadius# * Offset#)



Tab(Posted 2009) [#3]
The problem GfK is the wheel angle depending on the ground surface.


Warner(Posted 2009) [#4]
Suppose the wheel has a radius of 1, then the blue point would have a distance of 0.9 from the centre of the wheel.
You could maybe use TFormPoint to transform the point (0, 0.9, 0) from the wheel's transformation matrix into world coordinates:
TFormPoint 0, 0.9, 0, wheel, 0
positionentity skid, tformedx(), tformedy(), tformedz()



Stevie G(Posted 2009) [#5]
Warner's idea will work, assuming the wheel isn't turning on it's local pitch axis, which I suspect it will be?

Is that doesn't work this should :

Offset# = .9
SkidX# = RedX + ( GreenX - RedX ) * Offset
SkidY# = RedY + ( GreenY - RedY ) * Offset
SkidZ# = RedZ + ( GreenZ - RedZ ) * Offset
positionentity skid, SkidX, SkidY , SkidZ


Where Offset is the % distance between the red point and the green point.

Stevie


Tab(Posted 2009) [#6]
Thanks guys!. =)


Ross C(Posted 2009) [#7]
I just usually shuffle my pants a bit.