OK........
The problem is i want to have several numbers and i want them to change from the values sent to them by a socket and they will sometimes change very fast. It doesnt seem like a good way to have a texture for every digit and then change them.
But if thats the only solution there is, its not much to do...
I will leave this for another day or two and is noone can come up with a better solution for me i will give you the points.
Thanks for your answer!
/Dj
Main Topics
Browse All Topics





by: OutsideTheBoxPosted on 2006-10-22 at 06:07:48ID: 17783703
Sorry, I feel your pain,
/3DEngine. htm Scroll down to see the first four or five lessons.
DrawText only draws on to the window, not the objects in the window(like your cube). DrawText items have only an X,Y coord . They are the coords of the window client area, not 3d coords of your world.
If you have a cube that is spinning, one way to get the seconds (or time) on to each side of it is to create 10 textures (one for each number, 0 thru 9) & apply whichever of them you need to the sides in the right position and change them out as needed between frames. You may need 6 textures per face (2 for hours, 2 for min, two for sec) so the challenge would be in positioning them correctly. They can be swapped out between frames as necessary as time increments.
Applying textures to your cube is very similar to applying textures to a skybox. This is a common enough exercise that many tutorials show how it is done and give you the code. My favorite for C# & MDX is http://www.thehazymind.com
The difference between the skybox in the tutorial & your project is that your normals face outwards and you would need up to 6 textures per face instead of one. Also, your camera is outside the cube instead of inside.