PanelCam test

View previous topic View next topic Go down

PanelCam test

Post by RA2lover on Tue Feb 08, 2011 4:35 pm

Code:
// [RCD]
Val{
  BRAKE(default=0, min=-500, max=500, step=500)
  CAM1(default=0, max=16777216, disp=0)
  CAM10(default=0, max=16777216, disp=0)
  CAM11(default=0, max=16777216, disp=0)
  CAM12(default=0, max=16777216, disp=0)
  CAM13(default=0, max=16777216, disp=0)
  CAM14(default=0, max=16777216, disp=0)
  CAM15(default=0, max=16777216, disp=0)
  CAM16(default=0, max=16777216, disp=0)
  CAM17(default=0, max=16777216, disp=0)
  CAM18(default=0, max=16777216, disp=0)
  CAM19(default=0, max=16777216, disp=0)
  CAM2(default=0, max=16777216, disp=0)
  CAM20(default=0, max=16777216, disp=0)
  CAM21(default=0, max=16777216, disp=0)
  CAM22(default=0, max=16777216, disp=0)
  CAM23(default=0, max=16777216, disp=0)
  CAM24(default=0, max=16777216, disp=0)
  CAM25(default=0, max=16777216, disp=0)
  CAM26(default=0, max=16777216, disp=0)
  CAM27(default=0, max=16777216, disp=0)
  CAM28(default=0, max=16777216, disp=0)
  CAM29(default=0, max=16777216, disp=0)
  CAM3(default=0, max=16777216, disp=0)
  CAM30(default=0, max=16777216, disp=0)
  CAM31(default=0, max=16777216, disp=0)
  CAM32(default=0, max=16777216, disp=0)
  CAM33(default=0, max=16777216, disp=0)
  CAM34(default=0, max=16777216, disp=0)
  CAM35(default=0, max=16777216, disp=0)
  CAM36(default=0, max=16777216, disp=0)
  CAM37(default=0, max=16777216, disp=0)
  CAM38(default=0, max=16777216, disp=0)
  CAM39(default=0, max=16777216, disp=0)
  CAM4(default=0, max=16777216, disp=0)
  CAM40(default=0, max=16777216, disp=0)
  CAM41(default=0, max=16777216, disp=0)
  CAM42(default=0, max=16777216, disp=0)
  CAM43(default=0, max=16777216, disp=0)
  CAM44(default=0, max=16777216, disp=0)
  CAM45(default=0, max=16777216, disp=0)
  CAM46(default=0, max=16777216, disp=0)
  CAM47(default=0, max=16777216, disp=0)
  CAM48(default=0, max=16777216, disp=0)
  CAM49(default=0, max=16777216, disp=0)
  CAM5(default=0, max=16777216, disp=0)
  CAM50(default=0, max=16777216, disp=0)
  CAM51(default=0, max=16777216, disp=0)
  CAM52(default=0, max=16777216, disp=0)
  CAM53(default=0, max=16777216, disp=0)
  CAM54(default=0, max=16777216, disp=0)
  CAM55(default=0, max=16777216, disp=0)
  CAM56(default=0, max=16777216, disp=0)
  CAM57(default=0, max=16777216, disp=0)
  CAM58(default=0, max=16777216, disp=0)
  CAM59(default=0, max=16777216, disp=0)
  CAM6(default=0, max=16777216, disp=0)
  CAM60(default=0, max=16777216, disp=0)
  CAM61(default=0, max=16777216, disp=0)
  CAM62(default=0, max=16777216, disp=0)
  CAM63(default=0, max=16777216, disp=0)
  CAM64(default=0, max=16777216, disp=0)
  CAM7(default=0, max=16777216, disp=0)
  CAM8(default=0, max=16777216, disp=0)
  CAM9(default=0, max=16777216, disp=0)
  HANDLE(default=0, min=-30, max=30, step=1)
  PITCH(default=90, max=180)
  WHEEL(default=0, min=-5000, max=5000, step=500)
  YAW(default=0, min=-999999999, max=999999999)
}
Key{
  0:WHEEL(step=500)
  1:WHEEL(step=-500)
  2:HANDLE(step=1)
  3:HANDLE(step=-1)
  4:BRAKE(step=500)
  7:YAW(step=-1)
  8:PITCH(step=1)
  9:YAW(step=1)
  15:PITCH(step=-1)
}
Body{
  Core(){
    S:Frame(angle=PITCH, color=#888888){
      S:TrimF(angle=-YAW, color=#888888){
        S:Chip(angle=90){
          S:Rudder(angle=HANDLE){
            E:Frame(){
              E:Wheel(angle=-90, power=-WHEEL, brake=BRAKE){}
            }
            W:Frame(){
              W:Wheel(angle=-90, power=WHEEL, brake=BRAKE){}
            }
          }
          N:Weight(option=2){
            N:Chip(){
              E:Frame(){
                E:Wheel(angle=-90, power=-WHEEL, brake=BRAKE){}
              }
              W:Frame(){
                W:Wheel(angle=-90, power=WHEEL, brake=BRAKE){}
              }
              N:Chip(name=photoholder){
                N:Chip(){
                  E:Chip(){
                    E:Chip(){
                      E:Chip(){
                        E:Chip(){}
                      }
                    }
                  }
                  W:Chip(){
                    W:Chip(){
                      W:Chip(){}
                    }
                  }
                }
                E:Chip(){
                  E:Chip(){
                    E:Chip(){
                      E:Chip(){
                        N:Cowl(angle=90, color=CAM57){
                          N:Cowl(color=CAM49){
                            N:Cowl(color=CAM41){
                              N:Cowl(color=CAM33){
                                N:Cowl(color=CAM25){
                                  N:Cowl(color=CAM17){
                                    N:Cowl(color=CAM9){
                                      N:Cowl(color=CAM1){}
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                      N:Cowl(angle=90, color=CAM58){
                        N:Cowl(color=CAM50){
                          N:Cowl(color=CAM42){
                            N:Cowl(color=CAM34){
                              N:Cowl(color=CAM26){
                                N:Cowl(color=CAM18){
                                  N:Cowl(color=CAM10){
                                    N:Cowl(color=CAM2){}
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                    N:Cowl(angle=90, color=CAM59){
                      N:Cowl(color=CAM51){
                        N:Cowl(color=CAM43){
                          N:Cowl(color=CAM35){
                            N:Cowl(color=CAM27){
                              N:Cowl(color=CAM19){
                                N:Cowl(color=CAM11){
                                  N:Cowl(color=CAM3){}
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                  N:Cowl(angle=90, color=CAM60){
                    N:Cowl(color=CAM52){
                      N:Cowl(color=CAM44){
                        N:Cowl(color=CAM36){
                          N:Cowl(color=CAM28){
                            N:Cowl(color=CAM20){
                              N:Cowl(color=CAM12){
                                N:Cowl(color=CAM4){}
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
                W:Chip(){
                  W:Chip(){
                    W:Chip(){
                      N:Cowl(angle=90, color=CAM64){
                        N:Cowl(color=CAM56){
                          N:Cowl(color=CAM48){
                            N:Cowl(color=CAM40){
                              N:Cowl(color=CAM32){
                                N:Cowl(color=CAM24){
                                  N:Cowl(color=CAM16){
                                    N:Cowl(color=CAM8){}
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                    N:Cowl(angle=90, color=CAM64){
                      N:Cowl(color=CAM55){
                        N:Cowl(color=CAM47){
                          N:Cowl(color=CAM39){
                            N:Cowl(color=CAM31){
                              N:Cowl(color=CAM23){
                                N:Cowl(color=CAM15){
                                  N:Cowl(color=CAM7){}
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                  N:Cowl(angle=90, color=CAM62){
                    N:Cowl(color=CAM54){
                      N:Cowl(color=CAM46){
                        N:Cowl(color=CAM38){
                          N:Cowl(color=CAM30){
                            N:Cowl(color=CAM22){
                              N:Cowl(color=CAM14){
                                N:Cowl(color=CAM6){}
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
                N:Cowl(angle=90, color=CAM61){
                  N:Cowl(color=CAM53){
                    N:Cowl(color=CAM45){
                      N:Cowl(color=CAM37){
                        N:Cowl(color=CAM29){
                          N:Cowl(color=CAM21){
                            N:Cowl(color=CAM13){
                              N:Cowl(color=CAM5){}
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    W:Cowl(angle=90, color=#888888){
      W:Cowl(angle=90, color=#888888){
        W:Cowl(angle=90, color=#888888){}
      }
      S:Cowl(angle=-90, color=#888888, effect=#0FFF){
        E:Cowl(color=#FFFF00, effect=#0FFF){
          N:Cowl(color=#888888, effect=#0FFF){
            N:Cowl(color=#888888, effect=#0FFF){
              W:Cowl(color=#888888, effect=#0FFF){
                W:Cowl(angle=90, color=#888888, effect=#0FFF){
                  S:Cowl(color=#888888, effect=#0FFF){
                    S:Cowl(color=#888888, effect=#0FFF){}
                    W:Cowl(angle=90, color=#888888, effect=#0FFF){
                      W:Cowl(color=#888888, effect=#0FFF){
                        N:Cowl(color=#888888, effect=#0FFF){}
                        S:Cowl(color=#888888, effect=#0FFF){}
                      }
                      N:Cowl(color=#888888, effect=#0FFF){}
                      S:Cowl(color=#888888, effect=#0FFF){}
                    }
                  }
                }
              }
            }
          }
          E:Cowl(angle=90, color=#888888, effect=#0FFF){
            N:Cowl(color=#888888, effect=#0FFF){
              N:Cowl(color=#888888, effect=#0FFF){
                N:Cowl(angle=90, color=#888888, effect=#0FFF){
                  N:Cowl(color=#888888, effect=#0FFF){}
                }
              }
            }
            S:Cowl(angle=90, color=#888888, effect=#0FFF){
              S:Cowl(color=#888888, effect=#0FFF){}
            }
          }
        }
      }
    }
    S:Cowl(angle=90, color=#0080FF){}
    N:Cowl(angle=90, color=#0080FF, effect=#8000){}
  }
}
Lua{
function photocompress(x1,y1,x2,y2)
--uses the CCD
--gets the average color in the area between 2 pixels
local pixelcount, r , g , b
if r == nil then
r=0
g=0
b=0
end
pixelcount = math.abs(x1-x2)*math.abs(y1-y2)
for y=1, math.abs(y1-y2) do
for x=1, math.abs(x1-x2) do
r = r  + _RED(x,y)
g= g + _GREEN(x,y)
b= b + _BLUE(x,y)
end -- x scan end
end -- y scan end
r = math.floor(r /pixelcount)*256
g= math.floor(g/pixelcount)*256
b= math.floor(b/pixelcount)*256
return r,g,b
end

function rgb(r,g,b)
--converts individual r,g,and b values into a single number
return (math.floor(r)*65536)+(math.floor(g)*256)+math.floor(b)
end

function takephoto()
--takes a 64x64 photo from the CCD and displays it in 8x8 format
local pixelcount,tempcolor,count
count=0
for y=1 , 8 do
for x=1 , 8 do
count = count+1

_G["CAM"..count] = rgb(_RED(x*8,y*8)*256,_GREEN(x*8,y*8)*256,_BLUE(x*8,y*8)*256)
end
end
return count
end

function main()
_SPLIT(PHOTOHOLDER)

out(0,_CCD(32,32))
if _KEYDOWN(5)==1 then
takephoto()

end
end -- of main, not another user-created function. REMEMBER THAT!}

usual tank controls(arows control vehicle, wasd controls turret). Z takes a 0.004096 megapixel camera photo of the landscape.

i couldn't test it because my rigidchips CCD related functions aren't working(they return black, and for some of upper pixels, red.), can anyone check if the photo is mirrored/flipped or something like that?
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: PanelCam test

Post by supershade on Tue Feb 08, 2011 5:23 pm

Will do...BTW are the controls for how to shoot this thing(since it has a turret.) up there?

MOD EDIT: Please don't quote the post immediately above yours.
avatar
supershade
Hover
Hover

Posts : 107
Join date : 2011-02-07
Age : 21
Location : Norman,Oklahoma

View user profile

Back to top Go down

Re: PanelCam test

Post by RA2lover on Tue Feb 08, 2011 5:24 pm

it has no guns, just a camera.

RA2lover wrote:Z takes a 0.004096 megapixel camera photo of the landscape.
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: PanelCam test

Post by supershade on Tue Feb 08, 2011 5:27 pm

RA2lover wrote:it has no guns, just a camera.

RA2lover wrote:Z takes a 0.004096 megapixel camera photo of the landscape.
okay...still looks awesome...might be able to convince my friends to use other maps besides the default one...you know since they can see what others look like compared to the default one?...My friend tried to use a turret on me and guess what?I shot the part that held the turret so the turret top (with jets still on.)planted into the ground...it was awesome.
avatar
supershade
Hover
Hover

Posts : 107
Join date : 2011-02-07
Age : 21
Location : Norman,Oklahoma

View user profile

Back to top Go down

Re: PanelCam test

Post by RA2lover on Tue Feb 08, 2011 5:29 pm

the model has no arm chips, so it can't be shot down.
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: PanelCam test

Post by supershade on Tue Feb 08, 2011 5:31 pm

RA2lover wrote:the model has no arm chips, so it can't be shot down.
How do you tell when it works(all it seems to do is brake...) BTW what is the black screen for?
avatar
supershade
Hover
Hover

Posts : 107
Join date : 2011-02-07
Age : 21
Location : Norman,Oklahoma

View user profile

Back to top Go down

Re: PanelCam test

Post by RA2lover on Tue Feb 08, 2011 5:33 pm

it's supposed to be where the photo gets stored at
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: PanelCam test

Post by supershade on Tue Feb 08, 2011 5:39 pm

No image....whatso ever, although once the screen showed red squares on the bottom...couldn't you use lua script to fix this problem? Another way could be a scenario file...right? (please upload the files of one or the other...if you do...cuz windows 7 doesn't let renaming .txt files to .rcs and work...I think normally though I will try to when the script is done.)
avatar
supershade
Hover
Hover

Posts : 107
Join date : 2011-02-07
Age : 21
Location : Norman,Oklahoma

View user profile

Back to top Go down

Re: PanelCam test

Post by RA2lover on Tue Feb 08, 2011 5:41 pm

you can open .txt files on rigidchips.
anyways, it looks like the problem with the ccd functions isn't affecting only me.
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: PanelCam test

Post by supershade on Tue Feb 08, 2011 5:45 pm

ccd? I just started playing this several weeks ago in a financial literacy class( a friend showed me, so do you have backups of the tutorials stored on the original forums?)I examine the scripts and hope to make my own vehicle some day.
avatar
supershade
Hover
Hover

Posts : 107
Join date : 2011-02-07
Age : 21
Location : Norman,Oklahoma

View user profile

Back to top Go down

Re: PanelCam test

Post by RA2lover on Tue Feb 08, 2011 5:47 pm

CCD as the camera which can be used by pressing ctrl+F10, and a 64x64 pixel camera which can be used on scripts.

try loading basic(standard rigidchips vehicle) and check the R,G,and B values on the text. here all of them return 0
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: PanelCam test

Post by supershade on Tue Feb 08, 2011 5:50 pm

How do you exit this mode?
avatar
supershade
Hover
Hover

Posts : 107
Join date : 2011-02-07
Age : 21
Location : Norman,Oklahoma

View user profile

Back to top Go down

Re: PanelCam test

Post by RA2lover on Tue Feb 08, 2011 5:52 pm

you can use the menu and click on open chips, or use the ctrl+o shortcut. Basic is located on the resources folder
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: PanelCam test

Post by supershade on Tue Feb 08, 2011 5:56 pm

RA2lover wrote:you can use the menu and click on open chips, or use the ctrl+o shortcut. Basic is located on the resources folder
After opening "basic" then reopening panelcam, Entering the mode, pressing Z, then exiting the camera mode...only blackness was on the screen.
avatar
supershade
Hover
Hover

Posts : 107
Join date : 2011-02-07
Age : 21
Location : Norman,Oklahoma

View user profile

Back to top Go down

Re: PanelCam test

Post by RA2lover on Tue Feb 08, 2011 5:58 pm

that's a rigidchips bug, which usually can be solved by exiting then opening it again. anyway, it's like 11pm here right now, time to sleep
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: PanelCam test

Post by supershade on Tue Feb 08, 2011 6:04 pm

Still does not work for me I will try later right now I am stocking up on chips to preserve them and repost so all is not lost when they make a new forums, (wish my friend would upload the ones he has stored on the school computers...hey he browses the forums...his name is nathan he is a guest, but could you post something in all the topics telling everybody to pressure him to upload those unobtainable files? Like enboldin text at the top with several spaces below it, as well as in all caps?
avatar
supershade
Hover
Hover

Posts : 107
Join date : 2011-02-07
Age : 21
Location : Norman,Oklahoma

View user profile

Back to top Go down

Re: PanelCam test

Post by bwansy on Tue Feb 08, 2011 11:34 pm

There are a few problems that I have found so far:

1. Looking at your code, the key for shooting an image is X, not Z. Z is key #4.

2. The coordinates of the CCD goes from 0 to 63 on both x and y axes, while your code is trying to take the pixel at 64, which causes the black/red pixels.

3. Your image is rotated 90 degrees. I can't tell if it is mirrored, though, because the panel can be viewed from both sides.

_________________
A.K.A. Bernard

bwansy
Admin

Posts : 170
Join date : 2010-07-15

View user profile http://rigidchips.forum-motion.com

Back to top Go down

Re: PanelCam test

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum