Ask a Question related to Macromedia Director 3D, Design and Development.
-
ensamblador #1
Texture mapping and cloned models.
Hi,
I have been working in a project that, basically, it's a virtual scenario, it
have a lot of chairs. i import the chair model with the diffuse texture from
one cast member, and the chair model with the lightmap from another cast
member.
I apply the common method to map the light texture in the model:
pChairShadow.addModifier(#meshDeform)
pChair.addModifier(#meshDeform)
pChair.meshDeform.mesh[1].textureLayer.add()
pChair.meshDeform.mesh[1].texturelayer[2].textureCoordinateList=\
pChairShadow.meshDeform.mesh[1].texturelayer[1].textureCoordinateList
pChair.shader.diffuseLightMap=pSillaShadow.shader. texture
pChair.shader.textureModeList[2]=#none
when i execute this commands in a keydown script it works fine, but when i
execute inmediately after clone the models, the lighmap mess up.
Why did i do?, i created a timeOut object, so i wait 100 ms after call this
commands, it works fine.
When I call the commands in the first enterFrame, it works fine,
If I insert a breakpoint (BKP) and then press F5, messed up.
If I insert a BKP and hot F8 (command by command), messed up.
If I insert a BKP and hot F8 (command by command) viewing the 3d cast member
with the 3d viewer, fine.
I Think it is a time problem. I discover that it must be a delay between
cloning the model and apply the mesh modifier or assign the
texturecoordinatelist, more specific, i believe that there must be a visual
update of the cast member, Ive solved it by creating a timeout, but i like
clean solutions, not this.
EHHH, yes i preload all the members and its state is 4, at the moment of
cloning.
MMMM,
ensamblador Guest
-
Cloned models
Hi. I have a W3D scene where I created a lot of plants. They are all clones of the same model, so I figured it shouldn't make the file much... -
Mapping texture onto globe
Hi! I have a globe model with each of the continents having a different shader - this works fine to set the diffuse color of each continent.... -
5 models with the same texture, how!!??
i am a strager novice in director 3d and i have 5 models in my 3d world that need to have the same texture on them. i know how to apply on a model a... -
makeFixedRigidBody and cloned models
My apologies for the repost. I thought I was creating a new thread but I accidentally responded to a very old one instead. Again, my apologies,... -
Havok and cloned models
I saw that a few other people have had this problem, but didn't find any solutions that worked for me. I have a simple model, imported as a ..w3d.... -
Agustín María Rodríguez #2
Re: Texture mapping and cloned models.
ensamblador wrote:
Hi. What I did in this cases is to wait to the next frame. Kinda> Hi,
>
> I have been working in a project that, basically, it's a virtual scenario, it
> have a lot of chairs. i import the chair model with the diffuse texture from
> one cast member, and the chair model with the lightmap from another cast
> member.
>
> I apply the common method to map the light texture in the model:
>
> pChairShadow.addModifier(#meshDeform)
> pChair.addModifier(#meshDeform)
>
>
> when i execute this commands in a keydown script it works fine, but when i
> execute inmediately after clone the models, the lighmap mess up.
timeOut() solution but more clean. Here´s some not tested code just for
getting the idea:
on enterFrame me
case pState of:
#addMeshMod:
pChairShadow.addModifier(#meshDeform)
pChair.addModifier(#meshDeform)
pState = #addLayer
#addLayer:
pChair.meshDeform.mesh[1].textureLayer.add()
pChair.meshDeform.mesh[1].texturelayer[2].textureCoordinateList=\
pChairShadow.meshDeform.mesh[1].texturelayer[1].textureCoordinateList
pChair.shader.diffuseLightMap=pSillaShadow.shader. texture
pChair.shader.textureModeList[2]=#none
end case
Try if a solution like that works for you. Hey, and be grateful that
simply using chairShadow´s coordinates as they are on the chair works
for you and you´re not needing to brute-force-copy the
textureCoordinates of the shadowMesh by comparing vertex position and
storing the UV data in a text member, which is slower.
Regards,
--
Agustín María Rodríguez
[url]www.onwine.com.ar[/url] > Macromedia Director demos & code
Agustín María Rodríguez Guest



Reply With Quote

