Ask a Question related to Ruby, Design and Development.
-
openspark #21
Re: HELP ME
Replace the current beginSprite() handler with the one below to create a number
of boxes, each with a different shader. Now when you drop a color chip on a
model, only that model's color is changed.
on beginSprite(me) ---------------------------------------------------
-- ACTION: Initializes properties
--------------------------------------------------------------------
vSprite = sprite(me.spriteNum)
pMember = vSprite.member
pMember.resetWorld()
pLeft = vSprite.left
pTop = vSprite.top
pCamera = vSprite.camera
vResource = pMember.newModelResource("Box", #box)
-- Create a list of positions for 9 different box models
vPositions = []
vPositions.append(vector( 0, 0, 0))
vPositions.append(vector(-60, -60, -60))
vPositions.append(vector( 60, -60, -60))
vPositions.append(vector(-60, 60, -60))
vPositions.append(vector( 60, 60, -60))
vPositions.append(vector(-60, -60, 60))
vPositions.append(vector( 60, -60, 60))
vPositions.append(vector(-60, 60, 60))
vPositions.append(vector( 60, 60, 60))
-- Create 9 different box models, each with a different shader,
-- and disperse them
repeat with i = 1 to 9
vName = "Box "&i
vModel = pMember.newModel(vName, vResource)
vShader = pMember.newShader(vName, #standard)
vShader.texture = VOID
vModel.shaderList = vShader
vModel.worldPosition = vPositions[i]
end repeat
-- Move the camera so we can see all the boxes
vTransform = pCamera.transform
vTransform.position = vector(350.0000, 200.0000, 175.0000)
vTransform.rotation = vector(-30.0000, 64.0000, 0.0000)
-- Create a texture to drag
pTexture = pMember.newTexture("Overlay")
end beginSprite
openspark Guest
-
uddini #22
Re: HELP ME
Thanks, example given works great. However i come back to an earlier problem
concerning the box dimesions. I need to edit each individual box dimesions e.g
width , length and height. Before I created each individual box with the
original code and changed the dimensions with this line of code:
aResource = aMember.newModelResource("aBox", #box)
aResource.width = 5.0
aResource.height = 75
aResource.length = 40
So i had this code nine times, each one with its own name and different
dimensions to create a room model.
How will I use the code you given, plus state each individual box dimesions.
Any help will be most appreciated.
Good guess with the nine box?
uddini Guest
-
openspark #23
Re: HELP ME
In the stepFrame() handler in the Drag Shader Color behavior, you can change
the line...
??vShader.emissive = pColor
... to...
?? vShader.texture = pTexture
In the demo movie this will have quite a radical effect, as the change will
occur when you click on a color chip, not when you drop it on the model. Given
the nature of your application, you might prefer this. If so, you will need to
modify the behaviors so that the drag-and-drop feature is disactivated.
openspark Guest
-
Neron05 #24
Help Me
Hello,My Name Is Jamie,And I 14 Years of Age,And Want To Take In MY Fathers
Foot Steps in Being a Web Desighner.,. I Currently Use Dreamweaver Which Is
Very Cool Program.anyways Im Currently Working On Websites That Needs Fourms
..Such As This One..If Anyone Can Gimme Info On How To Make "forums" In
Dreamweaver I Would Appriciate It..Thanks :)
Neron05 Guest



Reply With Quote

