ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperLicht
forum topic indicator camera space to word space
person icon
cosmo
Registered User
Quote
2014-04-12 13:41:54

Hi,
sorry for maybe a stupid question.

How to convert vector, for example (0,1,0), from camera space to word space ?

I have tried several options and nothing really works.
For example, when I target camera at (0,1,0)
cam.setTarget(new CL3D.Vect3d(0, 1, 0));

and use inverted ViewMatrix
var m = cam.ViewMatrix; 
m.makeInverse();
var result = m.getTransformedVect(new CL3D.Vect3d(0,1,0));

I get
result = (0, 0.1, 1) instead of (0,0,-1)

person icon
niko
Moderator
Quote
2014-04-12 21:23:14

Hm, difficult to say, maybe you are using the view matrix before it is set during animation?

For what do you need this? If you want to use it to get positions on the screen in 3d space for example, it would be simpler to use the CopperLicht.get3DPositionFrom2DPosition() method, for example.

person icon
cosmo
Registered User
Quote
2014-04-13 11:05:07

Thanks very much. CopperLicht.get3DPositionFrom2DPosition() is working and just what I was looking for.


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |