This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-09-10 13:28:57

awsomemaster
Scratcher
Registered: 2008-04-10
Posts: 83

pinch and stretch

hey i was wondering if someone knew how to go about making a "pinch" effect block.
for example
"set [up,down,left,right] pinch to ( )"
the reason for this block is for 3d effect' combining this block and the stretch/v-stretch would mean we could "stretch" and "pinch" a texture over a wireframe surface for texturing. like if you use the v-stretch block it would look like the object was tilting back.
  but as things get farther away they appear to get smaller, so instead of just tilting back it could look like it was tilting back AND pinch the top for a proper 3d effect.


scar the REAL 3d fps we've all been waiting for

Offline

 

#2 2010-09-10 15:01:30

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: pinch and stretch

There is an obsolete stretch block, and it is pretty easy to get it to stretch in the other direction too.


/* No comment */

Offline

 

#3 2010-09-10 15:33:29

awsomemaster
Scratcher
Registered: 2008-04-10
Posts: 83

Re: pinch and stretch

TheSuccessor wrote:

There is an obsolete stretch block, and it is pretty easy to get it to stretch in the other direction too.

ya i know about the stretch blocks but i was hoping there would be a way to make a pinch block.


scar the REAL 3d fps we've all been waiting for

Offline

 

#4 2010-09-11 06:16:55

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: pinch and stretch

I don't know what you mean. Would stretching a negative amount work?


/* No comment */

Offline

 

#5 2010-09-11 13:38:59

awsomemaster
Scratcher
Registered: 2008-04-10
Posts: 83

Re: pinch and stretch

here i made a project about it


scar the REAL 3d fps we've all been waiting for

Offline

 

#6 2010-09-12 06:36:28

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: pinch and stretch

Hmmm... ...difficult. Ask nXIII.


/* No comment */

Offline

 

#7 2010-09-12 11:06:08

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: pinch and stretch

I think what you really want is skew as well as pinch, but the pinch would not do exactly as described in the project; it would decrease or increase each row of pixels' width linearly (zero at one end, w(n/100) at the other). Skew shifts each row of pixels linearly based on a percentage. These together could be used with the stretch blocks to create true 3d surfaces.


nXIII

Offline

 

#8 2010-09-12 15:08:21

awsomemaster
Scratcher
Registered: 2008-04-10
Posts: 83

Re: pinch and stretch

nXIII wrote:

I think what you really want is skew as well as pinch, but the pinch would not do exactly as described in the project; it would decrease or increase each row of pixels' width linearly (zero at one end, w(n/100) at the other). Skew shifts each row of pixels linearly based on a percentage. These together could be used with the stretch blocks to create true 3d surfaces.

ok well that's what i was hoping for anyway, but now how might one go about making it? or is it even possible?

Last edited by awsomemaster (2010-09-12 15:08:49)


scar the REAL 3d fps we've all been waiting for

Offline

 

#9 2010-09-12 15:21:02

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: pinch and stretch

Yea, I guess you could just use some BitBlt or Form methods, or you could write your own primitives.


nXIII

Offline

 

#10 2010-09-12 15:25:12

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: pinch and stretch

nXIII wrote:

Yea, I guess you could just use some BitBlt or Form methods, or you could write your own primitives.

bitblt sounds good.
as for writing my own prims, i think ill pass on that  tongue
i'm not too good at C, C++ Slang or any sort

Last edited by LS97 (2010-09-12 15:25:51)

Offline

 

#11 2010-09-12 22:16:37

awsomemaster
Scratcher
Registered: 2008-04-10
Posts: 83

Re: pinch and stretch

so you can't make it in to a block? and what's bitblt?


scar the REAL 3d fps we've all been waiting for

Offline

 

#12 2010-09-13 16:07:02

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: pinch and stretch

Bit Block Transfer. Just look in its class comment.


nXIII

Offline

 

#13 2010-09-13 20:26:07

awsomemaster
Scratcher
Registered: 2008-04-10
Posts: 83

Re: pinch and stretch

so where do we go from here? cause i couldn't code a scratch block to save my life lol.


scar the REAL 3d fps we've all been waiting for

Offline

 

#14 2010-09-15 13:19:19

awsomemaster
Scratcher
Registered: 2008-04-10
Posts: 83

Re: pinch and stretch

bump


scar the REAL 3d fps we've all been waiting for

Offline

 

#15 2011-02-06 12:42:21

---EPIC---
Scratcher
Registered: 2010-10-09
Posts: 2

Re: pinch and stretch

wait, how do you get the strech block?

Offline

 

#16 2011-07-14 23:55:06

poemon1
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: pinch and stretch

---EPIC--- wrote:

wait, how do you get the strech block?

('stretch by %n' #- #changeStretchBy: 5)
put that under looks


http://i47.tinypic.com/rrqe13.gif

Offline

 

#17 2011-09-28 08:08:08

jinggle
New Scratcher
Registered: 2010-09-21
Posts: 5

Re: pinch and stretch

poemon1 wrote:

---EPIC--- wrote:

wait, how do you get the strech block?

('stretch by %n' #- #changeStretchBy: 5)
put that under looks

I just stumbled on this, and have no idea how one goes about adding that under looks? Is there a place you click to access a field or something? After about 10 minutes of futzing around I found a downloadable project with, "set stretch to [number]%" and, "change stretch by [number]" and after playing with the two for less than 5 minutes I have to ask why these were removed? I was literally looking for a feature like this yesterday. I wanted to scale a line from an origin point to a destination point, and wound up having to settle for a much uglier (and I think complex) system of placing a series of off set sprites.

Are there plans to add a "change x size by [number]", "change y size by [number]", "set x size by [number]%" and, "set y size by [number]%" to scratch in the future? I could see these being arrow menus with the current size node to help keep the interface clean. Again with out such features why would they remove the one thing that did this?

Offline

 

#18 2011-09-28 09:17:56

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: pinch and stretch

jinggle wrote:

poemon1 wrote:

---EPIC--- wrote:

wait, how do you get the strech block?

('stretch by %n' #- #changeStretchBy: 5)
put that under looks

I just stumbled on this, and have no idea how one goes about adding that under looks? Is there a place you click to access a field or something? After about 10 minutes of futzing around I found a downloadable project with, "set stretch to [number]%" and, "change stretch by [number]" and after playing with the two for less than 5 minutes I have to ask why these were removed? I was literally looking for a feature like this yesterday. I wanted to scale a line from an origin point to a destination point, and wound up having to settle for a much uglier (and I think complex) system of placing a series of off set sprites.

Are there plans to add a "change x size by [number]", "change y size by [number]", "set x size by [number]%" and, "set y size by [number]%" to scratch in the future? I could see these being arrow menus with the current size node to help keep the interface clean. Again with out such features why would they remove the one thing that did this?

I don't know why they removed it.

To add that block to your Scratch, you'll have to open the browser.  There are some good tutorials on that around Advanced Topics.

Offline

 

#19 2011-09-28 09:59:54

rabbit1131
Scratcher
Registered: 2009-10-16
Posts: 1000+

Re: pinch and stretch

awsomemaster wrote:

TheSuccessor wrote:

There is an obsolete stretch block, and it is pretty easy to get it to stretch in the other direction too.

ya i know about the stretch blocks but i was hoping there would be a way to make a pinch block.

If you use a negative number it should work...


The Intergalactic Adventures of Revesilia! I hope you will partake in this gigantic undertaking, to build the sequel to the hit map The Adventures of Revesilia! The Intergalactic Adventures of Revesilia Map Builders Application thread! http://internetometer.com/image/35004.png

Offline

 

Board footer