About _SIO2transform on 1.3.2
5 posters
About _SIO2transform on 1.3.2
I've updated the whole code of my project to 1.3.2 but right now it does not appear anything on screen
I'm thinking if this may be because right now is working with _SIO2transform which has loc(location) dir(¿direction?) and scl (scale), because in this case I will have to change the whole code where I played with camera targets and the rotation of the objects of the whole project...
I've changed all transforms to work with the new version but from what I can see seems that this "dir" means direction and in this case I guess that there must be some another way to use it... I mean that we cant just say object->_SIO2transform->dir->z+=45.0f and expect it to spin 45degrees in z, right?
if right now is working with direction values, is there any way to "transform" these values to use them like the old version? I mean something like multiplying it against the world matrix or some trick like that... :S
I'm thinking if this may be because right now is working with _SIO2transform which has loc(location) dir(¿direction?) and scl (scale), because in this case I will have to change the whole code where I played with camera targets and the rotation of the objects of the whole project...
I've changed all transforms to work with the new version but from what I can see seems that this "dir" means direction and in this case I guess that there must be some another way to use it... I mean that we cant just say object->_SIO2transform->dir->z+=45.0f and expect it to spin 45degrees in z, right?
if right now is working with direction values, is there any way to "transform" these values to use them like the old version? I mean something like multiplying it against the world matrix or some trick like that... :S
exavi- Posts : 37
Join date : 2008-10-21
Re: About _SIO2transform on 1.3.2
Ah, btw I've tried to do:
sio2->_SIO2camera->_SIO2transform->dir->x = object->_SIO2transform->loc->x - sio2->_SIO2camera->_SIO2transform->loc->x;
sio2->_SIO2camera->_SIO2transform->dir->y = object->_SIO2transform->loc->y - sio2->_SIO2camera->_SIO2transform->loc->y;
sio2->_SIO2camera->_SIO2transform->dir->z = object->_SIO2transform->loc->z - sio2->_SIO2camera->_SIO2transform->loc->z;
which is "dir=tar-loc" (basically what you do when exporting) and it does not work well, the camera targets the object but does weird things with what it shows. like squashing the world. Do I still need to multiply by (0.001, 0.001, -1.001) ???
sio2->_SIO2camera->_SIO2transform->dir->x = object->_SIO2transform->loc->x - sio2->_SIO2camera->_SIO2transform->loc->x;
sio2->_SIO2camera->_SIO2transform->dir->y = object->_SIO2transform->loc->y - sio2->_SIO2camera->_SIO2transform->loc->y;
sio2->_SIO2camera->_SIO2transform->dir->z = object->_SIO2transform->loc->z - sio2->_SIO2camera->_SIO2transform->loc->z;
which is "dir=tar-loc" (basically what you do when exporting) and it does not work well, the camera targets the object but does weird things with what it shows. like squashing the world. Do I still need to multiply by (0.001, 0.001, -1.001) ???
exavi- Posts : 37
Join date : 2008-10-21
Re: About _SIO2transform on 1.3.2
...argh ok, I think that I have it fixed...
i added sio2Normalize(sio2->_SIO2camera->_SIO2transform->dir,sio2->_SIO2camera->_SIO2transform->dir);
after doing the dir=tar-loc thing it seems to work, but it seems also not to be exactly at the same position as before... this can be fixed by changing the pos values but maybe I forgot something else and it does not work when I try to plug the trick to my project. (right now I was just playing with a template)
please if someone can tell me if I still need to do something more to use this like 1.3.1, I would really appreciate it.
i added sio2Normalize(sio2->_SIO2camera->_SIO2transform->dir,sio2->_SIO2camera->_SIO2transform->dir);
after doing the dir=tar-loc thing it seems to work, but it seems also not to be exactly at the same position as before... this can be fixed by changing the pos values but maybe I forgot something else and it does not work when I try to plug the trick to my project. (right now I was just playing with a template)
please if someone can tell me if I still need to do something more to use this like 1.3.1, I would really appreciate it.
- Code:
sio2->_SIO2camera->_SIO2transform->dir->x = object->_SIO2transform->loc->x - sio2->_SIO2camera->_SIO2transform->loc->x;
sio2->_SIO2camera->_SIO2transform->dir->y = object->_SIO2transform->loc->y - sio2->_SIO2camera->_SIO2transform->loc->y;
sio2->_SIO2camera->_SIO2transform->dir->z = object->_SIO2transform->loc->z - sio2->_SIO2camera->_SIO2transform->loc->z;
sio2Normalize(sio2->_SIO2camera->_SIO2transform->dir,sio2->_SIO2camera->_SIO2transform->dir);
exavi- Posts : 37
Join date : 2008-10-21
Re: About _SIO2transform on 1.3.2
Also having some trouble with camera in 1.3.2. Using the camera in supplied tutorial blend files works fine but If I change the camera rotation in blender to point down z axis nothing displays back in engine (change to matrix creation since introduction of transforms?). Very odd anyway. I will test again this evening and post more info.
david4482- Posts : 7
Join date : 2009-01-24
Re: About _SIO2transform on 1.3.2
Can you send me that blend file that cause problem by email, so I can check it out?
Cheers,
Cheers,
Re: About _SIO2transform on 1.3.2
sio2, could you please tell me if I am missing something when making the camera look at something?
for some reason needs at least two frames to make it point at something the right way. and this weird inbetween frame is driving me crazy.
I thought that dir=tar-loc; would do the trick, am I missing something?
for some reason needs at least two frames to make it point at something the right way. and this weird inbetween frame is driving me crazy.
I thought that dir=tar-loc; would do the trick, am I missing something?
exavi- Posts : 37
Join date : 2008-10-21
Re: About _SIO2transform on 1.3.2
1. sio2Vec3Diff( tar, _SIO2transform->loc, _SIO2transform->dir )
2. sio2Normalize( _SIO2transform->dir, _SIO2transform->dir )
3. sio2TransformBindMatrix( _SIO2transtorm )
That's pretty much it....
2. sio2Normalize( _SIO2transform->dir, _SIO2transform->dir )
3. sio2TransformBindMatrix( _SIO2transtorm )
That's pretty much it....
Re: About _SIO2transform on 1.3.2
I'm in a similar situation:
I've implemented vec3diff/normalize/bind
The camera location is correct.
The camera direction is oriented toward my look target (and normalized)
But I still see nothing in the viewport - I'll keep at it to see if something else is not set correctly.
I've implemented vec3diff/normalize/bind
The camera location is correct.
The camera direction is oriented toward my look target (and normalized)
But I still see nothing in the viewport - I'll keep at it to see if something else is not set correctly.
autology- Posts : 22
Join date : 2008-12-29
Re: About _SIO2transform on 1.3.2
Ok, just to clarify, the only thing that have changed is that the tar variable have been taken out... basically the tar (target location in worldspace) was only used to calculate the camera direction...
So basically:
_SIO2transform->loc = worldspace position of the camera
_SIO2transform->dir = Direction vector ( normalized -1 to 1 ) to represent the camera direction
To calculate the dir:
tar (in WS) - loc (in WS) = dir
then normalize
then update the matrix of SIO2transform and that's it...
So basically:
_SIO2transform->loc = worldspace position of the camera
_SIO2transform->dir = Direction vector ( normalized -1 to 1 ) to represent the camera direction
To calculate the dir:
tar (in WS) - loc (in WS) = dir
then normalize
then update the matrix of SIO2transform and that's it...
Re: About _SIO2transform on 1.3.2
What you've said makes sense, and I can't seem to place the error:
Example:
camera loc-> 0,-10,0
target-> 0,0,0
and you would expect that a dir of -> |{0,10,0}| -> {0,1,0} should point at the object, but it's not.
I am also getting the perspective errors (object appears stretched) that others have mentioned previously.
Before I tear apart my current navigation code to debug this - any ideas?
Example:
camera loc-> 0,-10,0
target-> 0,0,0
and you would expect that a dir of -> |{0,10,0}| -> {0,1,0} should point at the object, but it's not.
I am also getting the perspective errors (object appears stretched) that others have mentioned previously.
Before I tear apart my current navigation code to debug this - any ideas?
- Code:
sio2Vec3Diff(tar, sio2->_SIO2camera->_SIO2transform->loc, sio2->_SIO2camera->_SIO2transform->dir );
sio2Normalize( sio2->_SIO2camera->_SIO2transform->dir, sio2->_SIO2camera->_SIO2transform->dir );
sio2TransformBindMatrix( sio2->_SIO2camera->_SIO2transform );
autology- Posts : 22
Join date : 2008-12-29
Re: About _SIO2transform on 1.3.2
I have also quite some problems with the camera.
sio2, please correct me if I am wrong:
As I understand the code, the sio2CameraRender function uses the cross product of the direction vector and (0,0,1) to calculate the sideway vector.
There seems to be no check in place if the direction vector is parallel to the z axis. Since I need a camera that is able to also look straight up or down I would get the gimbal lock problem.
Because of this and the fact the I need a camera roating around a fixed point int the distance, I use my own code to setup the model matrix based on some old quaternion code. Now I have the problem that I can't get billboards to work correctly. Is it possible that the billboard/halo code depends on the assumption that the camera up vector is always (0,0,1)?
I found a comment somewhere stating that you plan to add quaternions. I think it would be a good idea to base the camera code on quaterion rotation and make some tests for cameras with different up orientations.
I would like to help with that redesign, if possible.
sio2, please correct me if I am wrong:
As I understand the code, the sio2CameraRender function uses the cross product of the direction vector and (0,0,1) to calculate the sideway vector.
There seems to be no check in place if the direction vector is parallel to the z axis. Since I need a camera that is able to also look straight up or down I would get the gimbal lock problem.
Because of this and the fact the I need a camera roating around a fixed point int the distance, I use my own code to setup the model matrix based on some old quaternion code. Now I have the problem that I can't get billboards to work correctly. Is it possible that the billboard/halo code depends on the assumption that the camera up vector is always (0,0,1)?
I found a comment somewhere stating that you plan to add quaternions. I think it would be a good idea to base the camera code on quaterion rotation and make some tests for cameras with different up orientations.
I would like to help with that redesign, if possible.
Re: About _SIO2transform on 1.3.2
monsterkodi: I think quaternions would be the solution too. I was going to look into it but sounds like you are a good few steps ahead are already so would be great if you guys could get a redesign together.
david4482- Posts : 7
Join date : 2009-01-24
Re: About _SIO2transform on 1.3.2
Sure that would be great, send me your camera code using quaternion, as well as the blender integration and an example project (to show me that it works), and I will add it to the source tree!
Tks in advance,
Cheers,
Tks in advance,
Cheers,
Re: About _SIO2transform on 1.3.2
Well, I am not sure if I can pull this of by myself, since I am not very familiar with the internals of the engine yet.
But with your help it should be possible. I will start with "downgrading" my quaternion code from c++ to pure c and implement some functions to set up the camera transformations with it.
Have I been right with the billboard issue mentioned above? And/or are there any other dependancies on the camera transformations in other parts of the engine?
But with your help it should be possible. I will start with "downgrading" my quaternion code from c++ to pure c and implement some functions to set up the camera transformations with it.
Have I been right with the billboard issue mentioned above? And/or are there any other dependancies on the camera transformations in other parts of the engine?
Re: About _SIO2transform on 1.3.2
Ok, are there any other parts of the engine depending on this assumption?
Re: About _SIO2transform on 1.3.2
The billboard I guess nothing else that I can think of... Actually just putting back the up vector in the camera struct and do the necessary changes in the camera render function and sio2objectbillboard will do the trick.
Re: About _SIO2transform on 1.3.2
That sounds good. I will let you know when I have something accomplished. Probably this coming weekend.
Re: About _SIO2transform on 1.3.2
good news: i am alost finished with the quaternion based camera.
i have a set of working quaternion functions and a 'minimal invasive' change to the camera which doesn't break the old behaviour (which is really broken btw. )
not bad for 1.5 evenings
the remaining problems are the billboards and the correct fov.
blender has two modes for the fov (the little d button beside the lens value field). one is degrees, but the other one i couldn't figure out yet.
has anybody an idea how i can convert the other value to degrees?
i have a set of working quaternion functions and a 'minimal invasive' change to the camera which doesn't break the old behaviour (which is really broken btw. )
not bad for 1.5 evenings
the remaining problems are the billboards and the correct fov.
blender has two modes for the fov (the little d button beside the lens value field). one is degrees, but the other one i couldn't figure out yet.
has anybody an idea how i can convert the other value to degrees?
Re: About _SIO2transform on 1.3.2
never mind, i found it in the blender sources. the conversion from blender lens to degrees is
angle = 360.0 * atan(16.0/lensvalue) / M_PI
angle = 360.0 * atan(16.0/lensvalue) / M_PI
Re: About _SIO2transform on 1.3.2
any news regarding this subject?
sio2, did you have time to check out my camera implementation?
if yes, is it of any use? or do you need any changes?
sio2, did you have time to check out my camera implementation?
if yes, is it of any use? or do you need any changes?
Re: About _SIO2transform on 1.3.2
Yeah what you did is pretty good... I will integrate it with the 1.3.3 revision...
Re: About _SIO2transform on 1.3.2
If would be nice if you can also help me with the SIO2_IPO_CURVE_EXTRAPOLATION_CYCLIC_EXTRAPOLATION I never had time to finish it and its on my TODO list forever but as it constantly continue growing it has been pushed down
Lemme know if you need more info.
Cheers,
Lemme know if you need more info.
Cheers,
Re: About _SIO2transform on 1.3.2
good to hear that you can use my camera implementation.
since this problem is probably confusing a lot of people, i think it would be a good idea to make a sticky post which explains the limitations of the current camera system until the new release is out. any idea when it will (approximately) be finished?
concerning the ipo extrapolation:
i am not familiar with animation in blender. but i had a look at the documentation for the ipo curves and the missing extrapolation seems easy to implement.
do you have a test project (or at least a blender file) for testing the ipo curves? if yes, it would be nice if you could send it to me.
since this problem is probably confusing a lot of people, i think it would be a good idea to make a sticky post which explains the limitations of the current camera system until the new release is out. any idea when it will (approximately) be finished?
concerning the ipo extrapolation:
i am not familiar with animation in blender. but i had a look at the documentation for the ipo curves and the missing extrapolation seems easy to implement.
do you have a test project (or at least a blender file) for testing the ipo curves? if yes, it would be nice if you could send it to me.
Re: About _SIO2transform on 1.3.2
I'll create an example project and send it to you... I add that on my todo list right now
Cheers,
Cheers,
Permissions in this forum:
You cannot reply to topics in this forum