Page 2 of 3
Re: Problem with MapPixel...
Posted: Wed Mar 24, 2010 5:02 am
by bmelts
Oops. I typoed. Again. Obviously I shouldn't be coding this late.
I got the parameters reversed for the ternary parts - they should look like this:
Code: Select all
r = r > 255 and 255 or r
g = g > 255 and 255 or g
b = b > 255 and 255 or b
Re: Problem with MapPixel...
Posted: Wed Mar 24, 2010 2:29 pm
by pekka
MapPixel makes a lot of cross-language function calls between Lua and C++, so you should expect it to be slower than what you could do directly. There is some overhead associated with transferring data from C++ to Lua and vice versa, and if you need to do it twice for each pixel of a large image, it is going to add up. It's probably best not to think of using mapPixel every frame, but instead for one-off image transofrmations and preparing your graphics for particular uses.
Re: Problem with MapPixel...
Posted: Mon Mar 29, 2010 4:55 am
by TylerKinkade
This is going to sound kind of weird but why are you using sine and cosine functions? What is the purpose? What does it benefit. And what are the uses. That is something that has been bothering me for a long time now.
Re: Problem with MapPixel...
Posted: Mon Mar 29, 2010 6:15 am
by TechnoCat
TylerKinkade wrote:This is going to sound kind of weird but why are you using sine and cosine functions? What is the purpose? What does it benefit. And what are the uses. That is something that has been bothering me for a long time now.
You can get something to oscillate on and off with a sine or cosine function.
Re: Problem with MapPixel...
Posted: Tue Mar 30, 2010 3:01 am
by Jasoco
Sin and Cos will create a wave. Going up and down between 1 and -1 gracefully. It's a major part of drawing in 3D too or rotating points in 2D or 3D space.
Re: Problem with MapPixel...
Posted: Tue Mar 30, 2010 2:10 pm
by zachwlewis
Circles! Polar-coordinate systems! Figuring out the interior angles of anything.
Woah.
Re: Problem with MapPixel...
Posted: Tue Mar 30, 2010 5:17 pm
by Jasoco
Wallpaper, skyscrapers, funny papers, patterns!
Evergreens, nouvelle cuisine, human beings, patterns!
Garden rakes, wedding cakes, rattlesnakes, patterns!
Golden wheat, little feet, my heartbeat...
I gotta stop...
Patterns! Patterns! Patterns! Patterns!
Sorry.. that's what came to mind when you said that.
Re: Problem with MapPixel...
Posted: Tue Mar 30, 2010 6:54 pm
by zachwlewis
Jasoco wrote:Wallpaper, skyscrapers, funny papers, patterns!
Evergreens, nouvelle cuisine, human beings, patterns!
Garden rakes, wedding cakes, rattlesnakes, patterns!
Golden wheat, little feet, my heartbeat...
I gotta stop...
Patterns! Patterns! Patterns! Patterns!
Sorry.. that's what came to mind when you said that.
Whenever I see your avatar, I want to kiss you on your mouth. Then I feel awkward, because you're not Kate Micucci.
Re: Problem with MapPixel...
Posted: Tue Mar 30, 2010 8:59 pm
by Jasoco
Or am I?
No. No I'm not. Sorry.
Re: Problem with MapPixel...
Posted: Tue Mar 30, 2010 9:16 pm
by Robin
You should just use your own picture, like all normal* people here do.
* Normal not guaranteed. Possible side effects may include but are not limited to: slight rashes, occasional anxiety, loss of motor control, bowel control, and/or sense of humour.