#### Archived

This topic is now archived and is closed to further replies.

# vertices or pixel counter function in DX8??

This topic is 5308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
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 >
---

##### Share on other sites
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.

##### Share on other sites
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 >
---

##### Share on other sites
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.

1. 1
Rutin
47
2. 2
3. 3
4. 4
5. 5

• 10
• 27
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633405
• Total Posts
3011681
• ### Who's Online (See full list)

There are no registered users currently online

×