Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Flemming

  1. Nevermind! I must admit that this isn't the right solution for my project. Now i'm forced to go native with three.js. It must be the eseast and best bumpmap visualizer for the web. It would be nice if three.js was completely wrapped but i can't wait anymore.
  2. Hi Is it possible to get NormalMapFilter.js wrapped ? I would like to recreate this cool demo in sms: http://www.goodboydigital.com/pixijs/examples/20/ In case you will do it, the necessary files are in the attachment. Thanks Flemming pixi-normalmap.zip
  3. Ok - the Mega Demo showed me how to do it. I just changed it to a TW3GraphicControl, and it works fine now :-)
  4. Hi I started a project with the ArcSpiral demo as template. Now i realized that i want some forms and form-navigation. I tried adding this to TApplication.ApplicationStarting: FFormMain := TFormMain.Create(Display.View); FFormMain.Name := 'Main'; RegisterFormInstance(FFormMain, True); ... but how do i navigate between the form and the game-app ?
  5. 1. When i search with "Find in files" i allways get the "Not found" info messagebox, even when there is a search result ? 2. The "whole words" checkbox is not working ! 3. In the right of the messagebox there's a "Auto Hide" button. Clicking it gives me the error: "Control 'CustomDockPanel_PopupPanel' has no parent window" - and then i get this error every time i do a seach.
  6. Hi I can't find out where to find TRect in ver. 2.1 beta-2 ? It's not in smartCL.System ?
  7. Hi I can't get Web Worker running in Chrome ? Have tried the demo to.
  8. A little change here ! In the process of implementing the code in the Worker i realized that i could'n use btoa() and atob() !? So i replaced them with the functions from System.Encoding.pas. Do you know why they are not supported in sms workers ?
  9. I finally came to a solution that works. I tried to compare the encoding speed of System.Encoding.pas with the javascript btoa and found the javascript to be about 6 times faster. So i came up with this : // ---------------------------------- In the Worker thread TMyImageData = Record width : integer; height : integer; data : JUInt8ClampedArray; end; function Base64Encode_MyImageData(MyImgData:TMyImageData):string; var data,w,h : variant; begin w:=MyImgData.width; h:=MyImgData.height; data:=MyImgData.data; asm var w1 = (@w & 0xFF); var w2 = ((@w >&
  10. @kdtop3 thanks for your links ! It gives me an idea on how the base64 decoding works, but in respect to performance a javascript written decoder would be preferred. I want to transfer image data to a worker for imageprocessing and back again, and i try to do that without the use of DOM dependend objects in the worker. My samplecode is only to ensure that the encoding/decoding works. It would be nice if i could use base64 but im not sure how to do that in the worker without a canvas class ? If i can parse it to a TW3ImageData or some kind of array it would be fine.
  11. It should work ! The width, height and data are correctly parsed to the H2 handle, but i can't access the properties through imgdata2 ?
  12. I started out using the base64 solution, but then i found out that the Web Worker have no access the the DOM objects. I need to make some pixel processing in the Worker and the common java-solution for that is using the ImageData class. I dont know how to decode the base64 string in the Worker without a DOM object ? Im not sure about how the JSON part should work in this case, but could it possibly have something to do with the sms-classes being encoded with the ImageData.data part ? I tried using the handle but doesn seem to work either : ... H:=imgdata.Handle; asm @mT
  13. Hi I want to parse the content of a TW3ImageData with JSON for the use with Web Worker. But something is not working in the JSON/ImageData convertion. I made a little test sample : procedure TForm1.W3Button3Click(Sender: TObject); var imgdata, imgdata2: TW3ImageData; cont: TW3GraphicContext; canv: TW3Canvas; mText: string; begin img := TW3Image.Create(self); img.LoadFromURL('res/red3.png'); img.OnLoad := procedure (Sender: TObject) var i: integer; begin if img.Ready then
  14. Thanks André !!! :-) Can't wait to try it out ! Hopefully i will get it working, but anyway it's definitely worth a try ;-)
  15. I have been following the progress in Leap Motion the past year, but haven't bought it yet because of the lack of pascal support. If you guys would wrap it i'll buy it right away ! There's so many oportunitys for making cutting edge development with the Leap controller ! :-)
  16. Do you have any plans on wrapping Leap Motion ? It have now been done for Lazarus : http://www.freepascal.org/~michael/articles/leap1/leap1.pdf but i would be happy to see it implemented in sms !
  17. Hi I been fiddling with the fuatured Box2D demo. When i try running it on a external host i get the error "ReferenceError, Box2D is not defined". I been trying with the original Demo with same result. There's no problems with the old Box2D demo. Any idea on what's causing the error ?
  18. I would realy like to know how to transfer arraybuffer's with Web Worker ? I see no support for it in W3WebWorker ?
  19. Hi Is it possible to Transferable Objects to transfer arraybuffer's with Web Worker ?
  20. Thanks i got it now ! :-) So stupid of me !
  21. Hi I need to reference an element in a document but when i try looping through the elements the properties are all undefined ? Is it possible to get the reference to the element another way ? E.g. directly from the pascal created component ? asm var xname=''; var e = document.getElementsByTagName('*'); for (var i=0, x=e.length; i<x; i++){ xname=xname+' Id:'+e.id+' Class:'+e.ClassName;} alert(xname); end;
  22. Btw is TagRef depricated and can it be replaced with the handle in all circumstances like here ? : http://smartmobilestudio.com/documentation/differences-between-delphi-and-smart/
  23. Thanks i found it, but it would probably be an good idea to update the download-link in the blog ;-) and maybe the info about tagref replaced with the handle !?
  24. Hi I tried the Buddha demo : http://smartmobilestudio.com/2012/02/18/bling-up-your-apps/ But it throws an error : Syntax Error: There is no accessible member with name "TagRef" [line: 58, column: 35, file: form1] Tried with TagId but it's undefined ?
  25. Thanks André ! That was precisely the code i needed ! :-)
  • Create New...