Saving Out 3D World Scene Screenshot for student research projects - HELP !

6 views
Skip to first unread message

RichWhite

unread,
Jan 16, 2011, 12:36:49 PM1/16/11
to Open Cobalt
I am in collaboration with Kansas State University on a research
project this year exploring "Student Self Efficacy in STEM Subjects
using 3D Virtual Environments" .. the "3D virtual environments" are
Opensim and OpenCobalt ... I am REALLY wanting to be able to allow the
students to quickly take screen snapshots of their work and have
cobbled together something that appears to "almost" work, maybe. I
have been tinkering with writing out a scene screen shots to a server
for review .... below is what I have been using:


===========================
===== CODE BELOW ==========
===========================

publishSpaceNamed: spName description: desc

| url args result aContact contactXml form byteStream foo writer |
aContact := self getExternalContactInfo.
contactXml := aContact asJoinmeXmlString.

url := 'http://kindlelab.com/saved/publish.php'.
args := Dictionary new.
spName ifNotNil: [
args at: 'name' put: {spName}
].
desc ifNotNil:[
args at: 'description' put: {desc}
].
args at: 'postcard' put: {contactXml}.
args at: 'id' put: {aContact id asString}.

form := self ogl screenShot.
byteStream := RWBinaryOrTextStream on: (ByteArray new: 1000).
writer :=PNGReadWriter on: byteStream.
Cursor write showWhile: [
writer nextPutImage: form].
writer close.

foo := Base64MimeConverter mimeEncode: byteStream.
args at: 'screenshot' put: {foo contents}.

result := HTTPClient httpPostMultipart: url args: args.

Transcript show: result content.


===========================
====== END CODE ===========
===========================
Here are all the elements from the form that is being posted & written
to the server - http://kindlelab.com/saved/worlds.txt

... the actual image contents follow the "JPEG ScreenShot:" (this
should actually read "PNG Screenshot") text .... (minus header info)

"publish.php" saves the result out to the web server is what I would
expect to be a .png file ( using PNGReadWriter ) ... but when a .png
extension is applied to the resulting saved file .. error city ....
not 100% sure what I am looking at here so any help would be hugely
appreciated !



John Dougan

unread,
Jan 16, 2011, 6:16:18 PM1/16/11
to openc...@googlegroups.com
This is on 1.0 alpha 4?

PNG files should have as the chars "PNG" as the second through fourth bytes. Are they there?  You base64 encoded the image, check where you are  decoding  to see if it worked properly. (I usually use Hex Fiend http://ridiculousfish.com/hexfiend/ to check binary files).  The Squeak side looks fine to me, but I have no idea what youre doing on the back end.

Cheers,
  -- John





--
You received this message because you are subscribed to the "Open Cobalt" Google group.
To post to this group, send email to openc...@googlegroups.com
To unsubscribe from this group, send email to
opencobalt+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/opencobalt?hl=en



--
John Dougan
jdo...@acm.org

RichWhite

unread,
Jan 16, 2011, 8:52:29 PM1/16/11
to Open Cobalt
Thanks John ! .... On the web sever I am actually passing the image
string through base64_decode() via PHP ...... but its giving me
nothing useable for some reason. Here is what I end up with after
base64_decode() on the web server:
http://kindlelab.com/saved/base64convert.php



====

On Jan 16, 5:16 pm, John Dougan <jdou...@acm.org> wrote:
> This is on 1.0 alpha 4?
>
> PNG files should have as the chars "PNG" as the second through fourth bytes.
> Are they there?  You base64 encoded the image, check where you are  decoding
>  to see if it worked properly. (I usually use Hex Fiendhttp://ridiculousfish.com/hexfiend/to check binary files).  The Squeak side
> > to the server -http://kindlelab.com/saved/worlds.txt
>
> > ... the actual image contents follow the "JPEG ScreenShot:" (this
> > should actually read "PNG Screenshot") text .... (minus header info)
>
> > "publish.php" saves the result out to the web server is what I would
> > expect to be a .png file ( using PNGReadWriter ) ... but when a .png
> > extension is applied to the resulting saved file .. error city ....
> > not 100% sure what I am looking at here so any help would be hugely
> > appreciated !
>
> > --
> > You received this message because you are subscribed to the "Open Cobalt"
> > Google group.
> > To post to this group, send email to openc...@googlegroups.com
> > To unsubscribe from this group, send email to
> > opencobalt+...@googlegroups.com<opencobalt%2Bunsubscribe@googlegrou ps.com>
> > For more options, visit this group at
> >http://groups.google.com/group/opencobalt?hl=en
>
> --
> John Dougan
> jdou...@acm.org

RichWhite

unread,
Jan 16, 2011, 9:20:21 PM1/16/11
to Open Cobalt
Ah ..... found my error .... works now ! Just need to tweak the image
quality output via squeak ... thanks John ! .. BTW what Im getting now
- http://kindlelab.com/saved/worlds.jpg


===

On Jan 16, 5:16 pm, John Dougan <jdou...@acm.org> wrote:
> This is on 1.0 alpha 4?
>
> PNG files should have as the chars "PNG" as the second through fourth bytes.
> Are they there?  You base64 encoded the image, check where you are  decoding
>  to see if it worked properly. (I usually use Hex Fiendhttp://ridiculousfish.com/hexfiend/to check binary files).  The Squeak side
> > to the server -http://kindlelab.com/saved/worlds.txt
>
> > ... the actual image contents follow the "JPEG ScreenShot:" (this
> > should actually read "PNG Screenshot") text .... (minus header info)
>
> > "publish.php" saves the result out to the web server is what I would
> > expect to be a .png file ( using PNGReadWriter ) ... but when a .png
> > extension is applied to the resulting saved file .. error city ....
> > not 100% sure what I am looking at here so any help would be hugely
> > appreciated !
>
> > --
> > You received this message because you are subscribed to the "Open Cobalt"
> > Google group.
> > To post to this group, send email to openc...@googlegroups.com
> > To unsubscribe from this group, send email to
> > opencobalt+...@googlegroups.com<opencobalt%2Bunsubscribe@googlegrou ps.com>
> > For more options, visit this group at
> >http://groups.google.com/group/opencobalt?hl=en
>
> --
> John Dougan
> jdou...@acm.org

John Dougan

unread,
Jan 16, 2011, 11:29:41 PM1/16/11
to openc...@googlegroups.com
Excellent.  Any chance you could make the back end scripts available when you're done?

Cheers,
  -- John

RichWhite

unread,
Jan 16, 2011, 11:45:48 PM1/16/11
to Open Cobalt
.... Certainly John ! Thanks again for pointing me in the right
direction !


===

On Jan 16, 10:29 pm, John Dougan <jdou...@acm.org> wrote:
> Excellent.  Any chance you could make the back end scripts available when
> you're done?
>
> Cheers,
>   -- John
>
>
>
>
>
>
>
>
>
> On Sun, Jan 16, 2011 at 18:20, RichWhite <rich.lynn.wh...@gmail.com> wrote:
> > Ah ..... found my error .... works now ! Just need to tweak the image
> > quality output via squeak ... thanks John ! .. BTW what Im getting now
> > -http://kindlelab.com/saved/worlds.jpg

RichWhite

unread,
Jan 18, 2011, 5:10:06 PM1/18/11
to Open Cobalt
Here is the most straight forward way I could think of for sharing
what was done to get screen shot sharing/posting to the web from
Cobalt.

http://goo.gl/Cb5B2 <-- full size image/description here





<img src="https://docs.google.com/drawings/pub?
id=1YEu2oFpfjogiQgljlWeHanNYsGScazJTLw1Chn-ZLn8&amp;w=1554&amp;h=739">


====

On Jan 16, 10:29 pm, John Dougan <jdou...@acm.org> wrote:
> Excellent.  Any chance you could make the back end scripts available when
> you're done?
>
> Cheers,
>   -- John
>
>
>
>
>
>
>
>
>
> On Sun, Jan 16, 2011 at 18:20, RichWhite <rich.lynn.wh...@gmail.com> wrote:
> > Ah ..... found my error .... works now ! Just need to tweak the image
> > quality output via squeak ... thanks John ! .. BTW what Im getting now
> > -http://kindlelab.com/saved/worlds.jpg
Reply all
Reply to author
Forward
0 new messages