Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
camera space to word space

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)


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.


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:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (you are not logged in)


Text:

 

  

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


   






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