Panda3D/Manual/FAQ: diferenças entre revisões

182 bytes adicionados ,  28 de novembro de 2009
sem resumo de edição
[edição não verificada][edição não verificada]
(Criou nova página com 'Contents * 1 Q: What is the .pz files I am seeing the samples? o 1.1 A: Those are zipped files that are zipped with panda pzip/punzip command line tools tools...')
 
Sem resumo de edição
 
 
'''P: Porque todos os meus objetos planos parecem estranhos quando iluminados?
Q: Why do all my flat objects look weird when lit?
R: Planos geralmente não tem muitas vértices'''
A: Flats don't often have a lot of vertices.
 
Lighting is only calculated at the vertices, and then linearly interpolated between the vertices. If your vertices are very far apart, lighting can look very strange--for instance, a point light in the center of a large polygon might not show up at all (the light is far from all four vertices, even though it's very near the polygon's center).
 
Uma solução é criar um modelo com muitos polígonos para acompanhar a iluminação. Também ajuda fazer uma superficie plana ligeiramente curvada para melhorar sua aparência. Outra alternativa seria criar uma luz ambiente que apenas afete este objeto. Veja o manual para mais detalhes sobre vincular luz á objetos em sua cena.
One solution is to create a model with a lot of polygons to pick up the lighting. It also helps to make a flat surface slightly curved to improve its appearance. Another approach might be to create an ambient light that only affects this object. See the manual for more detail about attaching lights to objects in your scene.
 
'''P: Para suavizar minhas animações, eu usei a opção "interpolate-frames 1", mas por algum motivo isso não funciona. Porque?
R: A flag interpolate-frames é setada no PartBundle no momento que este é criado pela primeira vez, e então ela é >baked< no cache bam.'''
 
Por isso, mudanças realizadas posteriormente na variável interpolate-frames são nulas. Se você mudou a flag interpolate-frames, você também precisará limpar sua pasta modelcache.
Q: To smooth my animations, I used "interpolate-frames 1" option but it doesn't work somehow. Why?
A: Interpolate-frames flag gets set in the PartBundle at the time it is first created, and then baked into the bam cache.
 
Atualmente não é recomendado o uso de interpolate-frames; ele é uma configuração global. É melhor conseguir o mesmo efeito através de actor.setBlend(frameBlend = true ), que é uma configuração por ator ( e não é >baked< no cache de modelos )
Thenceforth, later changes to the interpolate-frames variable mean nothing. If you changed interpolate-frames flag, you will also need to empty your modelcache folder.
 
'''P: Eu estou tentando redirecionar o output de comandos como "myNode.ls()" para um arquivo, mas o método usual "python>>file, myNode.ls()" não funciona, Qual é a alternativa?
Actually, it is not recommended to use interpolate-frames; it is a global setting. It's better to achieve the same effect via actor.setBlend(frameBlend = True), which is a per-actor setting (and doesn't get baked into the model cache).
R: Você pode tentar:'''
 
 
Q: I'm trying to redirect the output of some commands like "myNode.ls()" to a file but the usual method "python >>file, myNode.ls()" doesn't work. What's the alternative?
A: You can try:
 
strm = StringStream()
open('out.txt', 'w').write(strm.getData())
 
Outra alternativa:
In alternative:
 
strm = StringStream()
open('out.txt', 'w').write(strm.getData())
 
IfSe youvocê don'tnão wantquiser to useusar a StringStream youvocê pode canfazer doo thisseguinte:
 
strm = MultiplexStream()
render.ls(strm)
 
ThereExiste istambém alsoum ameio wayde toespecificar specifyo thearquivo filea toser writeescrito tono in thearquivo config file.
 
notify-output out.txt
 
 
Q'''P: HowComo donós wecriamos createum anodo nodede from auma string containingcontendo fonte .egg source?
AR: Use thea EggDataclasse classEggData:'''
 
egg = EggData()
 
 
'''P: Como nós podemos saber que letra estava abaixo do cursor quando nós clicamos em um TextNode?
R: Use a classe TextAssembler como a seguir:'''
 
tn = TextNode('tn')
259

edições