Re: Bouncing balls in Curl
which section of the documentation teaches me how to a. replace the random number generated with a name from a csv file in the format : 1,name1,2,name2,3,name3... b. use coordinates to generate the sphere? like sphere(radius = 1,... ) etc.. thanks Kamal Bhatt <[EMAIL PROTECTED]> wrote: There are various ways to do what you want. The example below uses an HBox. I would suggest reading more about different containers and see what suits you best for your appli cation. The other choices could be a say a Canvas or a Grid. {curl 4.0 applet}{curl-file-attributes character-encoding = "windows-latin-1"}{applet {compiler-directives careful? = true}} {let c1:Canvas = {Canvas width = 6in, height = 5in, border-width = 1pt, background = ""}}{value c1} {let message1:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }}{let message2:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }} {let random:RolledRandom = {RolledRandom 0, 100}}{let f:Frame = {Frame halign = "center", width = 2in, color = "red", font-size = 22pt }} {let box:HBox = {HBox {Frame halign = "left", message1}, & nbsp; f, {Frame halign = "right", message2} }} {do let start-x:Distance = 2in, start-y:Distance = 1in {c1.add x = start-x, y = start-y, box} let start-time:DateTime = {DateTime} let drop-time:Time = 3s {box.animate frequency = 60fps, {on TimerEvent do let elapsed-time:Time = {start-time.elapsed} let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time} let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy box, start-x, y} {f.add {random.next-roll}, replace? = true} } }||-- {c1.add||-- x = 2in,||-- y = 1in,||-- {text font-weight = "bold", Words}||-- } }- Original Message - From: pang tee To: curlbreaker-l@curl.com Sent: Sunday, December 25, 2005 11:31 AM Subject: Re: Bouncing balls in CurlThanks Duke and Kamal for the response. I had added another bouncing ball to what was posted here earlier. Can you tell me how i can make the 2 balls separated by a horizontal distance of 2in and the random number appears between the 2 balls? Yahoo! PhotosRing in the New Year with Photo Calendars. Add photos, events, holidays, whatever. {curl 4.0 applet}{curl-file-attributes character-encoding = "windows-latin-1"}{applet {compiler-directives careful? = true}}{let c1:Canvas = {Canvas width = 6in, height = 5in, border-width = 1pt, background = ""}}{value c1}{let message1:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }}{let message2:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, &nbs p; height = 1in, width = 1in }}{let overlay:OverlayBox = {OverlayBox {Frame halign = "left", message1}, {Frame halign = "right", message2}, {Frame valign = "bottom", height = 1in, {huge color = "red",Lucky Number!} } }}{do let start-x:Distance = 2in, start-y:Distance = 1in {c1.add x = start-x, y = start-y, overlay} let start-time:DateTime = {DateTime} let drop-time:Time = 3s {overlay.animate frequency = 60fps, {on Ti merEvent do let elapsed-time:Time = {start-time.elapsed} let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time} let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy overlay, start-x, y} } } {c1.add x = 2in, y = 1in, {text font-weight = "bold", Words} }}***To unsubscribe from this list, send a mail to:mailto:[EMAIL PROTECTED]To contact a human list administrator, send a mail to:mailto:[EMAIL PROTECTED]To recieve a list of other options for this list, send a mail to:mailto:[EMAIL PROTECTED] Yahoo! Photos Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
Re: Bouncing balls in Curl
Here is the requested code. I am putting here two examples. In the first one the buttons themselves animate, and in the second one they do not. Example 1. {curl 4.0 applet}{curl-file-attributes character-encoding = "windows-latin-1"}{applet {compiler-directives careful? = true}} {let c1:Canvas = {Canvas width = 10in, height = 5in, border-width = 1pt, background = ""}}{value c1} {let message1:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }}{let message2:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }} {let random:RolledRandom = {RolledRandom 0, 100}}{let f:Frame = {Frame halign = "center", width = 2in, color = "red", font-size = 22pt }} {let timer:#Timer}{let box:HBox = {HBox {Frame halign = "left", message1}, f, {Frame halign = "right", message2}, {CommandButton label="Start", {on Action do {if-non-null timer then set timer.repeat = -1 } } }, {CommandButton label="Stop", {on Action do {if-non-null timer then set timer.repeat = 0 } } } }} {do let start-x:Distance = 2in, start-y:Distance = 1in {c1.add x = start-x, y = start-y, box} let start-time:DateTime = {DateTime} let drop-time:Time = 3s set timer = {box.animate frequency = 60fps, repeat = 0, {on TimerEvent do let elapsed-time:Time = {start-time.elapsed} let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time} let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy box, start-x, y} {f.add {random.next-roll}, replace? = true} } } }||-- {c1.add||-- x = 2in,||-- y = 1in,||-- {text font-weight = "bold", Words}||-- }} Example 2. {curl 4.0 applet}{curl-file-attributes character-encoding = "windows-latin-1"}{applet {compiler-directives careful? = true}} {let c1:Canvas = {Canvas width = 6in, height = 5in, border-width = 1pt, background = "" }} {value c1} {let message1:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }}{let message2:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }} {let random:RolledRandom = {RolledRandom 0, 100}}{let f:Frame = {Frame halign = "center", width = 2in, color = "red", font-size = 22pt }} {let box:HBox = {HBox {Frame halign = "left", message1}, f, {Frame halign = "right", message2} }} {do let start-x:Distance = .1in, start-y:Distance = 1in let start-time:DateTime = {DateTime} let drop-time:Time = 3s let timer:Timer = {box.animate frequency = 10fps, repeat = 0, {on TimerEvent do let elapsed-time:Time = {start-time.elapsed} let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time} let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy box, start-x, y} {f.add {random.next-roll}, replace? = true} } } {c1.add x = start-x, y = start-y, box } {c1.add x = 5in, y = start-y, {spaced-hbox {CommandButton label="Start", {on Action do set timer.repeat = -1 } }, {CommandButton label="Stop", {on Action do set timer.repeat = 0 } } } }} -- Kamal - Original Message - From: pang tee To: curlbreaker-l@curl.com Sent: Tuesday, December 27, 2005 9:32 PM Subject: Re: Bouncing balls in Curl Hi, I have tried to add 2 buttons, first button to start the bouncing balls and the random number generation 2nd button to stop the bouncing balls and the random number generation. But due to the arrangement of the variables/parame
Re: Bouncing balls in Curl
Hi, I have tried to add 2 buttons, first button to start the bouncing balls and the random number generation 2nd button to stop the bouncing balls and the random number generation. But due to the arrangement of the variables/parameters, i cant seem to get the button to work. (i.e the parameter t appears after the button definition.) Could someone help me to quickly complete this portion please? My demo to the CEO if i want to show Curl will be 1.5 days away. Thanks,PTKamal Bhatt <[EMAIL PROTECTED]> wrote: There are various ways to do what you want. The example below uses an HBox. I would suggest reading more about different containers and see what suits you best for your application. The other choices could be a say a Canvas or a Grid. {curl 4.0 applet}{curl-file-attributes character-encoding = "windows-latin-1"}{applet {compiler-directives careful? = true}} {let c1:Canvas = {Canvas width = 6in, height = 5in, border-width = 1pt, background = ""}}{value c1} {let message1:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }}{let message2:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }} {let random:RolledRandom = {RolledRandom 0, 100}}{let f:Frame = {Frame halign = "center", width = 2in, color = "red", font-size = 22pt }} {let box:HBox = {HBox {Frame halign = "left", message1}, f, {Frame halign = "right", message2} }} {do let start-x:Distance = 2in, start-y:Distance = 1in {c1.add x = start-x, y = start-y, box} let start-time:DateTime = {DateTime} let drop-time:Time = 3s {box.animate frequency = 60fps, {on TimerEvent do let elapsed-time:Time = {start-time.elapsed} let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time} let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy box, start-x, y} {f.add {random.next-roll}, replace? = true} } }||-- {c1.add||-- x = 2in,||-- y = 1in,||-- {text font-weight = "bold", Words}||-- } }- Original Message - From: pang tee To: curlbreaker-l@curl.com Sent: Sunday, December 25, 2005 11:31 AM Subject: Re: Bouncing balls in CurlThanks Duke and Kamal for the response. I had added another bouncing ball to what was posted here earlier. Can you tell me how i can make the 2 balls separated by a horizontal distance of 2in and the random number appears between the 2 balls? Yahoo! PhotosRing in the New Year with Photo Calendars. Add photos, events, holidays, whatever. {curl 4.0 applet}{curl-file-attributes character-encoding = "windows-latin-1"}{applet {compiler-directives careful? = true}}{let c1:Canvas = {Canvas width = 6in, height = 5in, border-width = 1pt, background = ""}}{value c1}{let message1:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }}{let message2:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }}{let overlay:OverlayBox = {OverlayBox {Frame halign = "left", message1}, {Frame halign = "right", message2}, {Frame valign = "bottom", height = 1in, {huge color = "red",Lucky Number!} } }}{do let start-x:Distance = 2in, start-y:Distance = 1in {c1.add x = start-x, y = start-y, overlay} let start-time:DateTime = {DateTime} let drop-time:Time = 3s {overlay.animate frequency = 60fps, {on TimerEvent do let elapsed-time:Time = {start-time.elapsed} let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time} let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy overlay, start-x, y} } } {c1.add x = 2in, y = 1in, {text font-weight = "bold", Words} }} ***To unsubscribe from this list, send a mail to:mailto:[EMAIL PROTECTED]To contact a human list administrator, send a mail to:mailto:[EMAIL PROTECTED]To recieve a list of other options for this list, send a mail to:mailto:[EMAIL PROTECTED] Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping {curl 4.0 applet} {curl-file-attributes character-encoding = "windows-latin-1"} {applet {compiler-directives careful? = true} } {let c1:Canvas = {Canvas width = 10in, height = 5in, border-width = 1pt, background = "yellow"} } {value c1} {let messa
Re: Bouncing balls in Curl
There are various ways to do what you want. The example below uses an HBox. I would suggest reading more about different containers and see what suits you best for your application. The other choices could be a say a Canvas or a Grid. {curl 4.0 applet}{curl-file-attributes character-encoding = "windows-latin-1"}{applet {compiler-directives careful? = true}} {let c1:Canvas = {Canvas width = 6in, height = 5in, border-width = 1pt, background = ""}}{value c1} {let message1:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }}{let message2:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }} {let random:RolledRandom = {RolledRandom 0, 100}}{let f:Frame = {Frame halign = "center", width = 2in, color = "red", font-size = 22pt }} {let box:HBox = {HBox {Frame halign = "left", message1}, f, {Frame halign = "right", message2} }} {do let start-x:Distance = 2in, start-y:Distance = 1in {c1.add x = start-x, y = start-y, box} let start-time:DateTime = {DateTime} let drop-time:Time = 3s {box.animate frequency = 60fps, {on TimerEvent do let elapsed-time:Time = {start-time.elapsed} let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time} let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy box, start-x, y} {f.add {random.next-roll}, replace? = true} } }||-- {c1.add||-- x = 2in,||-- y = 1in,||-- {text font-weight = "bold", Words}||-- } } - Original Message - From: pang tee To: curlbreaker-l@curl.com Sent: Sunday, December 25, 2005 11:31 AM Subject: Re: Bouncing balls in Curl Thanks Duke and Kamal for the response. I had added another bouncing ball to what was posted here earlier. Can you tell me how i can make the 2 balls separated by a horizontal distance of 2in and the random number appears between the 2 balls? Yahoo! PhotosRing in the New Year with Photo Calendars. Add photos, events, holidays, whatever. {curl 4.0 applet}{curl-file-attributes character-encoding = "windows-latin-1"}{applet {compiler-directives careful? = true}}{let c1:Canvas = {Canvas width = 6in, height = 5in, border-width = 1pt, background = ""}}{value c1}{let message1:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }}{let message2:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in }}{let overlay:OverlayBox = {OverlayBox {Frame halign = "left", message1}, {Frame halign = "right", message2}, {Frame valign = "bottom", height = 1in, {huge color = "red",Lucky Number!} } }}{do let start-x:Distance = 2in, start-y:Distance = 1in {c1.add x = start-x, y = start-y, overlay} let start-time:DateTime = {DateTime} let drop-time:Time = 3s {overlay.animate frequency = 60fps, {on TimerEvent do let elapsed-time:Time = {start-time.elapsed} let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time} let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy overlay, start-x, y} } } {c1.add x = 2in, y = 1in, {text font-weight = "bold", Words} }} ***To unsubscribe from this list, send a mail to:mailto:[EMAIL PROTECTED]To contact a human list administrator, send a mail to:mailto:[EMAIL PROTECTED]To recieve a list of other options for this list, send a mail to:mailto:[EMAIL PROTECTED]
Re: Bouncing balls in Curl
Thanks Duke and Kamal for the response. I had added another bouncing ball to what was posted here earlier. Can you tell me how i can make the 2 balls separated by a horizontal distance of 2in and the random number appears between the 2 balls? Yahoo! Photos Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.{curl 4.0 applet} {curl-file-attributes character-encoding = "windows-latin-1"} {applet {compiler-directives careful? = true} } {let c1:Canvas = {Canvas width = 6in, height = 5in, border-width = 1pt, background = "yellow"} } {value c1} {let message1:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in } } {let message2:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in } } {let overlay:OverlayBox = {OverlayBox {Frame halign = "left", message1}, {Frame halign = "right", message2}, {Frame valign = "bottom", height = 1in, {huge color = "red",Lucky Number!} } } } {do let start-x:Distance = 2in, start-y:Distance = 1in {c1.add x = start-x, y = start-y, overlay} let start-time:DateTime = {DateTime} let drop-time:Time = 3s {overlay.animate frequency = 60fps, {on TimerEvent do let elapsed-time:Time = {start-time.elapsed} let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time} let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy overlay, start-x, y} } } {c1.add x = 2in, y = 1in, {text font-weight = "bold", Words} } } *** To unsubscribe from this list, send a mail to: mailto:[EMAIL PROTECTED] To contact a human list administrator, send a mail to: mailto:[EMAIL PROTECTED] To recieve a list of other options for this list, send a mail to: mailto:[EMAIL PROTECTED]
Re: Bouncing balls in Curl
On Dec 24, 2005, at 9:53 AM, Kamal Bhatt wrote: Go to Surge Control Panel. Select the Security Options Tab. Then click on "This Computer". Click on "Add Privileged Directory". This will bring up a Dialog box with a text field. In the text field type "c:\". Press OK. -- Kamal - Original Message - From: pang tee To: Duke Briscoe ; curlbreaker-l@curl.com Sent: Saturday, December 24, 2005 9:19 AM Subject: Re: Bouncing balls in Curl How do i solve the error below? - An error occurred while loading this applet. SecurityException: An unprivileged applet tried to read the local file 'file:///c:/control-panel-logo.gif'. This message is caused by an error in the applet, not by a problem with Surge or your computer. This is only happening because you are running the applet from a file rather than a web server. Typically during development you would use a web server, perhaps http://localhost/. The IDE provides a license you can use for http://localhost/. Or you can just run the applet as a file: URL and privileged, although that may cause it to behave differently than the typical deployment situation where the applet will be at an http: URL and unprivileged. -- Duke *** To unsubscribe from this list, send a mail to: mailto:[EMAIL PROTECTED] To contact a human list administrator, send a mail to: mailto:[EMAIL PROTECTED] To recieve a list of other options for this list, send a mail to: mailto:[EMAIL PROTECTED]
Re: Bouncing balls in Curl
Go to Surge Control Panel. Select the Security Options Tab. Then click on "This Computer". Click on "Add Privileged Directory". This will bring up a Dialog box with a text field. In the text field type "c:\". Press OK. -- Kamal - Original Message - From: pang tee To: Duke Briscoe ; curlbreaker-l@curl.com Sent: Saturday, December 24, 2005 9:19 AM Subject: Re: Bouncing balls in Curl How do i solve the error below? - An error occurred while loading this applet. SecurityException: An unprivileged applet tried to read the local file 'file:///c:/control-panel-logo.gif'. This message is caused by an error in the applet, not by a problem with Surge or your computer.Duke Briscoe <[EMAIL PROTECTED]> wrote: pang tee wrote:> > Can someone make this 3D ball bounce at the click of a button and after > 2 seconds stop the ball in mid air and make a random number appear on > the face of the ball while the ball becomes bigger?/nearer to the screen?> > Thanks.> > */pang tee <[EMAIL PROTECTED]>/* wrote:> > Is there any way to create bouncing balls in Curl?See my attached applet for part of what you want t o do. You could substitute an image of a ball instead of the image I used.> > I looked at the documentation and it seems sphere is used to distort> a picture or input.> > Seems easier for me to just to used flash... is it correct?Many animations are probably easier to do with Flash than with Curl's current tools.-- Duke{curl 4.0 applet}{curl-file-attributes character-encoding = "windows-latin-1"}{applet{compiler-directives careful? = true}}{let c1:Canvas ={Canvas width = 6in, height = 5in, border-width = 1pt, background = ""}}{value c1}{let message:EllipseGraphic = {EllipseGraphicfill-color = {url "control-panel-logo.gif"},height = 1in, width = 1in}}{let overlay:OverlayBox = {OverlayBox{Frame valign = "center", message},{Frame valign = "center",height = 1in,{huge color = "red",Lucky Number!{do < BR>let start-x:Distance = 2in, start-y:Distance = 1in{c1.add x = start-x, y = start-y, overlay}let start-time:DateTime = {DateTime}let drop-time:Time = 3s{overlay.animate frequency = 60fps,{on TimerEvent dolet elapsed-time:Time = {start-time.elapsed}let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time}let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy overlay, start-x, y __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Bouncing balls in Curl
How do i solve the error below? - An error occurred while loading this applet. SecurityException: An unprivileged applet tried to read the local file 'file:///c:/control-panel-logo.gif'. This message is caused by an error in the applet, not by a problem with Surge or your computer.Duke Briscoe <[EMAIL PROTECTED]> wrote: pang tee wrote:> > Can someone make this 3D ball bounce at the click of a button and after > 2 seconds stop the ball in mid air and make a random number appear on > the face of the ball while the ball becomes bigger?/nearer to the screen?> > Thanks.> > */pang tee <[EMAIL PROTECTED]>/* wrote:> > Is there any way to create bouncing balls in Curl?See my attached applet for part of what you want t o do. You could substitute an image of a ball instead of the image I used.> > I looked at the documentation and it seems sphere is used to distort> a picture or input.> > Seems easier for me to just to used flash... is it correct?Many animations are probably easier to do with Flash than with Curl's current tools.-- Duke{curl 4.0 applet}{curl-file-attributes character-encoding = "windows-latin-1"}{applet{compiler-directives careful? = true}}{let c1:Canvas ={Canvas width = 6in, height = 5in, border-width = 1pt, background = ""}}{value c1}{let message:EllipseGraphic = {EllipseGraphicfill-color = {url "control-panel-logo.gif"},height = 1in, width = 1in}}{let overlay:OverlayBox = {OverlayBox{Frame valign = "center", message},{Frame valign = "center",height = 1in,{huge color = "red",Lucky Number!{do < BR>let start-x:Distance = 2in, start-y:Distance = 1in{c1.add x = start-x, y = start-y, overlay}let start-time:DateTime = {DateTime}let drop-time:Time = 3s{overlay.animate frequency = 60fps,{on TimerEvent dolet elapsed-time:Time = {start-time.elapsed}let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time}let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy overlay, start-x, y__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Bouncing balls in Curl
pang tee wrote: Can someone make this 3D ball bounce at the click of a button and after 2 seconds stop the ball in mid air and make a random number appear on the face of the ball while the ball becomes bigger?/nearer to the screen? Thanks. */pang tee <[EMAIL PROTECTED]>/* wrote: Is there any way to create bouncing balls in Curl? See my attached applet for part of what you want to do. You could substitute an image of a ball instead of the image I used. I looked at the documentation and it seems sphere is used to distort a picture or input. Seems easier for me to just to used flash... is it correct? Many animations are probably easier to do with Flash than with Curl's current tools. -- Duke {curl 4.0 applet} {curl-file-attributes character-encoding = "windows-latin-1"} {applet {compiler-directives careful? = true} } {let c1:Canvas = {Canvas width = 6in, height = 5in, border-width = 1pt, background = "yellow"} } {value c1} {let message:EllipseGraphic = {EllipseGraphic fill-color = {url "control-panel-logo.gif"}, height = 1in, width = 1in } } {let overlay:OverlayBox = {OverlayBox {Frame valign = "center", message}, {Frame valign = "center", height = 1in, {huge color = "red", Lucky Number!} } } } {do let start-x:Distance = 2in, start-y:Distance = 1in {c1.add x = start-x, y = start-y, overlay} let start-time:DateTime = {DateTime} let drop-time:Time = 3s {overlay.animate frequency = 60fps, {on TimerEvent do let elapsed-time:Time = {start-time.elapsed} let t:Time = {abs (elapsed-time mod drop-time*2) - drop-time} let y:Distance = start-y + 0.5 * 2(cm/s^2)*(t * t) {c1.move-to-xy overlay, start-x, y} } } } *** To unsubscribe from this list, send a mail to: mailto:[EMAIL PROTECTED] To contact a human list administrator, send a mail to: mailto:[EMAIL PROTECTED] To recieve a list of other options for this list, send a mail to: mailto:[EMAIL PROTECTED]
Re: Bouncing balls in Curl
Can someone make this 3D ball bounce at the click of a button and after 2 seconds stop the ball in mid air and make a random number appear on the face of the ball while the ball becomes bigger?/nearer to the screen? Thanks.pang tee <[EMAIL PROTECTED]> wrote: Is there any way to create bouncing balls in Curl? I looked at the documentation and it seems sphere is used to distort a picture or input. Seems easier for me to just to used flash... is it correct?Duke Briscoe <[EMAIL PROTECTED]> wrote: On Dec 18, 2005, at 10:39 PM, pang tee wrote:> Thanks Kamal,> > ; I tried to combine the two codes together, but ended with the errors > attached in randomgenerator.doc.> > Actually i just to get the screen to appear like in > randomgenerator.jpg if anyone can help. The shape that is in the code > here is calling rectangles not spheres.> > Thanks,> PTThe error is telling you that a View can only have one graphical child, while you have two, one is the random number and the other is the Canvas. So you need to choose some other layout.***To unsubscribe from this list, send a mail to:mailto:[EMAIL PROTECTED]To contact a human list administrator, send a mail to:mailto:[EMAIL PROTECTED]To recieve a list of other options for this list, send a mail to:mailto:[EMAIL PROTECTED] __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com {curl 4.0 applet} {import * from CURL.GRAPHICS.SCENE} {define-proc public {sphere-vertices-normals hres:int, vres:int}: ({Array-of FloatDistance3d}, {Array-of FloatDirection3d}) let vertices:{Array-of FloatDistance3d} = {{Array-of FloatDistance3d}.from-size (hres + 1) * (vres + 1), {FloatDistance3d 0f(m), 0f(m), 0f(m)} } let normals:{Array-of FloatDirection3d} = {{Array-of FloatDirection3d}.from-size (hres + 1) * (vres + 1), {FloatDirection3d 0, 0, 0} } let n:int = 0 {for i:int = 0 to hres do {for j:int = 0 to vres do let azimuth:FloatAngle = -180f(deg) + i * 360f(deg)/hres let elevation:FloatAngle = -90f(deg) + j * 180f(deg)/vres set vertices[n] = {FloatDistance3d ({cos azimuth} * {cos elevation}) * 1f(in), ({sin azimuth} * {cos elevation}) * 1f(in), ({sin elevation}) * 1f(in) } set normals[n] = vertices[n]/1f(in) {inc n} } } {return vertices, normals} } {define-proc public {mesh-faces hres:int, vres:int}:#{Array-of #{Array-of int}} let faces:#{Array-of #{Array-of int}} = {{Array-of #{Array-of int}}.from-size hres * vres, null} let n:int = 0 {for i:int = 0 to hres - 1 do {for j:int = 0 to vres - 1 do set faces[n] = {new {Array-of int}, i * (vres + 1) + j, (i + 1) * (vres + 1) + j, (i + 1) * (vres + 1) + j + 1, i * (vres + 1) + j + 1 } {inc n} } } {return faces} } {define-class public Sphere {inherits PolygonSet} field hres:int field vres:int {constructor public {default hres:int = 20, vres:int = 10, ...} {construct-super ... } set self.hres = hres set self.vres = vres set (self.vertices, self.normals) = {sphere-vertices-normals hres, vres} set self.faces = {mesh-faces hres, vres} } {method open public {paint renderer:Renderer3d, viewport-width:Distance, viewport-height:Distance}:void {with renderer.cull-face-enabled? = true do {super.paint renderer, viewport-width, viewport-height} } } {method open public {get-local-bounding-box check-visibility?:bool = false }:(min-xyz:Distance3d, max-xyz:Distance3d, valid-bounds?:bool) {return {Distance3d -1in, -1in, -1in}, {Distance3d 1in, 1in, 1in}, not check-visibility? or self.bounding-box-or-object-visible? } } } {value let scene:Scene = {Scene} let camera:Camera = scene.camera let camera-target:Distance3d = {Distance3d 0ft, 0ft, 0ft} let camera-position:Distance3d = {Distance3d 2in, -1in, 2in} let camera-direction:Direction3d = {(camera-target - camera-position).direction} let up:Direction3d = {Direction3d 0, 0, 1} {camera.set-orientation-and-position camera-direction, up, position = camera-position} set camera.projection = Projection.perspective set camera
Bouncing balls in Curl
Is there any way to create bouncing balls in Curl? I looked at the documentation and it seems sphere is used to distort a picture or input. Seems easier for me to just to used flash... is it correct?Duke Briscoe <[EMAIL PROTECTED]> wrote: On Dec 18, 2005, at 10:39 PM, pang tee wrote:> Thanks Kamal,> > I tried to combine the two codes together, but ended with the errors > attached in randomgenerator.doc.> > Actually i just to get the screen to appear like in > randomgenerator.jpg if anyone can help. The shape that is in the code > here is calling rectangles not spheres.> > Thanks,> PTThe error is telling you that a View can only have one graphical child, while you have two, one is the random number and the other is the Canvas. So you need to choose some other layout.***To unsubscribe from this list, send a mail to:mailto:[EMAIL PROTECTED]To contact a human list administrator, send a mail to:mailto:[EMAIL PROTECTED]To recieve a list of other options for this list, send a mail to:mailto:[EMAIL PROTECTED] __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com