@darkvee
Quote: "The way I want this to work is I render the point cloud. At the points it starts the texturing. I then fill the area up and begin the draw call process. Instead of texturing the whole model 360 degrees it only textures what you see. I hope this explains the process I want."
There's a lot of talk about directX and C++ and so forth. But believe it or not, this kind of stuff was pulled off in QBASIC and AmigaBASIC in the past. Since computers are much faster now, and DarkBASIC Pro compiles to machine code (or a fast BYTE code - I'm not sure which) you could pull this off in DBPro. Like I mentioned early, Kevin Picone was doing this kind of thing in DarkBASIC Classic like 10 years ago. You'll have to wrap your brain around the concepts to understand it. The syntax (language) is just the syntax, but the methods and ideas are what you want to grasp.
I have an OK understanding of the 3D to 2D point process for mapping vertices. I also have a loose conceptual understanding of a 2D texture mapping across a "3D" surface.
Lets say you had a plane object with 4 vertices and it was square/flush with the screen/camera so you could see one entire side. The top left vertex had UVs of (0,0) and the bottom right had UVs of (1,1).
Let's also say you've already translated the 3D vertex coordinates to the 2D screen and the top two vertices were at (100,100) and (200,100). That's a span of 100 units across X.
Now, let's say your texture size is 256x256. That's 256 units across X. It's your task to find out how to map these 256 pixels across 100 pixels based on the UVs. Our UVs are easy in this case - it's 0 to 1 or 0 to 100% of the texture going straight across. The problem is finding out how you want to "squeeze" the 256 pixels into 100 pixels.
The first step is to find the start and end of our texture position based on the UVs.
StartX of texture = U1 * Texturesize X
StartX = 0 * 255
StartX = 0
Our end X based on our connected UVs straight across:
EndX of texture = U2 * Texturesize X
EndX = 1.0 * 255
EndX = 255
So far so good. Now, there are only 100 spots to fill with our texture so we'll have to pick the pixels we want:
pixelspacingX = 255.0/100.0
Based on how the UVs are connected by edges on a face, we find the same pixel spacing in the Y direction. Our face in this example is a simple square (quad). We always want the extremes of Xs and Ys for our face even if it is a triangle. That means we find the lowest U and V and the highest U and V and interpolate between those values in each direction (X and Y) to populate our face with the texture.
Our example is easy because it just so happens that the Y spacing is exactly the same as the X spacing.
To map the texture on our surface, we simple loop through the implied UVs for the whole surface:
offsetX=100
offsetY=100
For X=0 to 100
U=X/100.0
For Y=0 to 100
V=Y/100.0
textureX=U*255
textureY=V*255
draw_texture_pixel(texture,textureX,textureY,X+offsetX, Y+offsetY)
Next Y
Next X
The textureX and textureY values above are really just a variation of our pixelspacing that we calculated previously. It tells us which pixels we are going to choose from the texture because we can't pick them all. In our example, we could eliminate 2 divides and use the pixelspacing value if we wanted to speed things up a little.
The draw_texture_pixel function above would be code you implement to copy the pixel data from the image to the screen.
This is the basic concept of the process. You would have to adapt this for triangular faces and for edges that aren't aligned squarely to the camera. Also, you may include blending, dithering, and/or anti-aliasing to smooth out the pixels.
There are shortcuts like copying whole blocks of pixel data from the texture under certain circumstances instead of always mapping 1 texture pixel at a time.
You can also use the built in BITMAP and COPY bitmap functions in DBPro to help you out with the interpolation. There are a lot of possibilities but the first thing is to get a solid understanding of what you are trying to do.
Enjoy your day.