vertices or pixel counter function in DX8??

Started by
3 comments, last by farhanx 19 years, 11 months ago
IS there any function in directX8 in which suppose if i give first pixel/vertex number and then second pixel/vertex, in return i''ll get the array of all vertices/pixels who are between them. I know i can make this function by my self but it would be so slow so i am wondering if directx8 has this utility function or not? Thanks in advance
Things has been changed but the just the way it is....
Advertisement
I''m not exactly clear what you are asking for here... are you looking to implement a line drawing algorithm between two points? If possible try and elaborate a little more on what you are trying to achieve.

Regards,
Sharky



---
< SharkyUK.com & Sharky''s Coding Corner >
< Professional Engine Programmer - Strangelite Studio >
---
Actully no i am not asking for line stuff, i am asking if there is any kind of function which can tell how many points comes between 2 points ...
suppose if i have two point on a screen
1)point1 (x1,y1,z1)
2)point2 (x10,y10,z10)

now between these points there would be a big distance , just i want the middle points of array between them....for sure distance between them have different point as well

point1 (-------------------------------) point2
i want these points between them

is there any function which can perform this calculation , i dont wana make mine cuz it would be slow.


Things has been changed but the just the way it is....
The only function I can immediately think of (for finding points between two endpoints) is the D3DXVec3Lerp function. It will perform the interpolation for you and you will have to store the intermediary values in an array yourself. Alternatively you could write your own interpolation routine (which I believe you don''t want to do!) The parameters (and more information) for the D3DXVec3Lerp function are in the SDK documentation. I hope this helps...

---
< SharkyUK.com & Sharky''s Coding Corner >
< Professional Engine Programmer - Strangelite Studio >
---
Hmmm,

I am not sure if this helps, but you could move Point1 to the origin and get a direction vector pointing to point 2 starting at point 1. Then you could go in that direction by a unitized amount.

PointBetween = Point1 + Direction*UnitValue;

Unit value could be obtained by the smallest number
your willing to use. For example. If you willing to do 1,000 operations:

UnitValue = Distance between points/1000


But I think there are nearly infinite amounts of "points". I think it is best to compute UnitValue based on the number of iterations you are willing to do.

2 points miles away polling at the resolution of millimeters would be horribly slow I think



quote:Original post by farhanx
Actully no i am not asking for line stuff, i am asking if there is any kind of function which can tell how many points comes between 2 points ...
suppose if i have two point on a screen
1)point1 (x1,y1,z1)
2)point2 (x10,y10,z10)

now between these points there would be a big distance , just i want the middle points of array between them....for sure distance between them have different point as well

point1 (-------------------------------) point2
i want these points between them

is there any function which can perform this calculation , i dont wana make mine cuz it would be slow.




This topic is closed to new replies.

Advertisement