It looks like you're new here. If you want to get involved, click one of these buttons!
Is there a way to assign a transformation to a collection of entities? Essentially, I want to be able to do the pushMatrix() ... popMatrix()
of the non-Craft system.
In a little more detail, suppose that I have some entities each with their own position and rotation. It might be that those positions and rotations change with time. Then I want to apply a single transformation to the entire group. I can cycle through them and modify them one by one, but keeping track of the "external" and "internal" transformations will be a bit of a headache. What I'd really like to be able to do is have a parent entity and set the transformations on that, and have them percolate down to its children.
I've not figured out how to do this natively in Craft as yet (obviously, I can implement it by hand but I'm asking if there's already the capability in Craft so that I don't need to).
Comments
@John Thanks! That never occurred to me. I thought I had to
:add
them but that wasn't working.Right. Time to experiment with AR ...
I just used this in the Craft Coaster project and one bit confused me for a bit. If you set
.position
before.parent
then the.position
information gets lost.That is,
resets the position of
e
to the origin, whereas:doesn't.
If this is
status-by-design
then I think it is worth noting somewhere. If not, then can I request that it not happen like that? There seems no value to it.When are you going to release the demo?
@Bri_G You flatter me. I'm just experimenting, same as everyone else. Maybe I've been thinking about 3D in Codea longer than most ....
The code for the sky is:
PseudoMesh is from the other thread, the
addSphere
method is from my mesh extension library but you should be able to guess what it does - the inbuilt icososphere would do as well if you inverted the normals, the star map is from NASA (link in the youtube video).I just need to pull the code into a single project before releasing it.
Thanks @LoopSpace I’m off to play