ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator ccbGet3DPosFrom2DPos - not working
person icon
cm20
Guest
Quote
2023-02-06 18:18:54

I used this example;

var mouseX = ccbGetMousePosX();
var mouseY = ccbGetMousePosY();

var anode = ccbGetSceneNodeFromName("somenode");
var pos3d = ccbGet3DPosFrom2DPos(mouseX, mouseY);
ccbSetSceneNodeProperty(anode, "Position", pos3d);


from the documentation and it doesn't work.
the cube some. It only appears when I put only the x and z axis.
keeping the Y when you move the mouse above its position in the world it disappears. when you move down it appears.

I want a 3d object always in a 2d position on the screen a fake 2d overplay.

person icon
okeoke
Registered User
Quote
2023-02-07 13:09:46

Hi cm20,

I don't think you're using the funciton for what it's designed to do.

If you want some object to be presented as sort of overlay you can just put it in front of your camera in the editor and parent it to the camera node.


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 |