| View previous topic :: View next topic |
| Author |
Message |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Tue Apr 11, 2006 5:54 pm Post subject: scale images |
|
|
anyone got an idea about scaling an image over time?
(i do not mean x2,x3,x4... the pixels.)
more like photoshop.
thanks a lot
lumo _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Wed Apr 12, 2006 1:18 am Post subject: |
|
|
We have a function for OpenGL. It is called glScale(size). It works in both 2D and 3D scenes. Size can be any number like 1.23 or 0.73.
If we have implementation for Lua Player, it would be gl.Scale(size). Too bad, we don't have the implementation yet.
Anyone dare to implement?
PS: I am switching old GLUT with a newer version called GLFW for my implementation in Windows environment.
PSS: I had compared FPS rates between codes in C/C++ and Lua. They are about the same!! Thanks to the power of GPU. Hence, Lua is no problem for being so slow. _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Wed Apr 12, 2006 1:22 am Post subject: |
|
|
yeah could create a plane in GU apply texture and scale it...
thought there could be an easier way ;)
greets _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
matriculated
Joined: 04 Mar 2006 Posts: 31
|
Posted: Wed Apr 12, 2006 6:31 am Post subject: |
|
|
| LuMo wrote: |
thought there could be an easier way ;)
greets |
I hope that's a sign of things to come! |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Wed Apr 12, 2006 7:58 am Post subject: |
|
|
| matriculated wrote: | | LuMo wrote: |
thought there could be an easier way ;)
greets |
I hope that's a sign of things to come! |
what do you expect? _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
my psprecious
Joined: 17 Feb 2006 Posts: 24
|
Posted: Wed Apr 12, 2006 10:18 am Post subject: |
|
|
Hey LuMo
you think something can be done with this
function Image:magnify(mag)
mag = mag or 2 -- 2 times in size by default
local w = self:width()
local h = self:height()
local result = Image.createEmpty(mag*w, mag*h)
for x = 0, w-1 do
for y = 0, h-1 do
result:fillRect(mag*x, mag*y, mag,mag, self:pixel(x,y))
end
end
return result
end
My be a start for what I want, if only I understood exactly what it do, man my maths are far..... |
|
| Back to top |
|
 |
romero126
Joined: 24 Dec 2005 Posts: 200
|
Posted: Wed Apr 12, 2006 10:29 am Post subject: |
|
|
| nope cant be done with that :-) |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Wed Apr 12, 2006 6:35 pm Post subject: |
|
|
scaling&rotate is not trivial :o(
[except 90/180/etc rotation and x2,x3,etc scaling.] _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Thu Apr 13, 2006 12:13 am Post subject: |
|
|
Yeah, but PSPgl or PSPgu is much faster, even with fractional arguments. _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Thu Apr 13, 2006 12:16 am Post subject: |
|
|
i know :D as its using the hardware _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
|