Piorun Posted September 2, 2017 Posted September 2, 2017 Hi, My suggestion is to create two functions: dxRotateTexture and dxScaleTexture (ofc. for oop is Texture:rotate() and Texture:scale()) which will return new rotated and scaled texture or will work on texture in parameter.
MTA Team Lpsd Posted September 3, 2017 MTA Team Posted September 3, 2017 How are you using your texture? Functions such as dxDrawImage and dxDrawImage3D already have rotation arguments. I don't work with shaders much either, but if you're using your texture with a shader I assume you can just rotate the texture using the shader itself.
Jusonex Posted September 3, 2017 Posted September 3, 2017 You can already do that with render targets, i.e.: Create the render target with suitable dimensions Call dxSetRenderTarget(renderTarget) Draw the texture once using dxDrawImage (+ scale/rotate) Reset the render target: dxSetRenderTarget(nil) The resulting render target is your scaled/rotated texture
Piorun Posted September 3, 2017 Author Posted September 3, 2017 It's working! Nice, thanks. One simple question: is this technique faster than normal calculations, for loops and dxSetPixelColor?
Recommended Posts