My Actor's Eyes - what to do?

Blitz3D Forums/Blitz3D Beginners Area/My Actor's Eyes - what to do?

Mikorians(Posted 2012) [#1]
[RESOLVED]
In my original engine in Visual Basic, I had a .x skinned mesh, and I translated the relevant texture to move the eyes (they're not spheres).

How can I now move my actor's eyes in BlitzBasic3D?
What do you folks do?

In a mesh full of entities, how can I access an existing texture to translate it perhaps using positiontexture (not just eyes, water, lava) - it's what I USED to DO. I need some handles to these child entities and textures people!

Last edited 2012

Last edited 2012


Yasha(Posted 2012) [#2]
Handles to child entities are mainly a matter of using FindChild.

Assuming you can find the right mesh, you can extract a texture autoloaded onto it with GetEntityBrush (or if it's just one surface in a larger mesh, with GetSurfaceBrush: note that there is no naming system for surfaces, you're on your own with those). To quote the manual, "Once you have got the brush handle from an entity, you can use GetBrushTexture and TextureName to get the details of what texture(s) are applied to the brush."

i.e. Use GetBrushTexture to return a texture handle (there is no hint given as to how many textures are applied to a brush, so you have to know this in advance, preferably just the one for your purposes), and then compare that handle's TextureName to the filename of the texture you want to reposition. Note that texture names are just filenames, not custom properties like entity names.

Then use FreeBrush after testing the brush in question (whether it held the right texture or not), because both GetXBrush commands return a copy, not the original. This will not delete the texture, which is not a copy and whose handle can be stored safely (in fact, textures are reference-counted and cached internally which may cause some odd effects if you manipulate their pixels).


Mikorians(Posted 2012) [#3]
Thanks! I'll give it a try.


Mikorians(Posted 2012) [#4]
Great! Now all I have to do is compromise and combine and place my pupil and iris texture maps over the entire eye section of the object, and only resize the underlying vertex-bones when the texture is front and center!

Acceptable!

Now I can have my fountains again and my lava!
You've been most helpful!

I will no doubt have a few questions to ask in the weeks ahead-
But not too many...
I will now consider purchasing the manual myself soon.

I may have some contributions to add: A primitive but useful force-feedback client to post for everybody to try-- unless you all have a dll access trick I should know about...


Yasha(Posted 2012) [#5]
I really can't tell whether you're pleased or not...


I will now consider purchasing the manual myself soon.


By "the manual" I meant the Blitz3D help section viewable in the IDE. The paper manual is pretty much just the same thing, only printed (it's nice to have, but be aware that you already have the information, probably in a more up-to-date form).


Zethrax(Posted 2012) [#6]
As for the manual, also bare in mind that there's an online version which may be more up to date and may include user comments which add extra context. Link is below.

http://www.blitzbasic.com/b3ddocs/docs.php


Mikorians(Posted 2012) [#7]
Ah, I am VERY happy folks!
'tis an easy compromise.
Thanks for all your help.

[UPDATE]
Yes, my eyes are now manipulable.

Last edited 2012