get to get the xPosition of an object

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

get to get the xPosition of an object

Post by 804 »

I'm going to program a minecraft like terrain, but I have a simple problem :(

I don't know how to get the x-position of my objects (blocks).
I tried this,

Code: Select all

node->getPosition();
but it only returns the 3df position-vector.

By the way, what do you think about these photos:
Image
Image
http://www.darkgdk.de/index.php?page=At ... 1e87c464c1
http://www.darkgdk.de/index.php?page=At ... 165974cae3
(the photo shows an chunk of blocks created by my simple world generator)
Sorry for my bad english, but I'm an german ;)
Last edited by 804 on Thu Nov 10, 2011 8:37 pm, edited 1 time in total.
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: get to get the xPosition of an object

Post by serengeor »

learn a bit of c++ and oop and problems like these will be easy to solve.
Working on game: Marrbles (Currently stopped).
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: get to get the xPosition of an object

Post by 804 »

I learned c++ (and OOP) one year ago, but...
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: get to get the xPosition of an object

Post by serengeor »

804 wrote:I learned c++ (and OOP) one year ago, but...
but what? Maybe you have problems opening API page and finding functions for what you need?
if so: http://irrlicht.sourceforge.net/docu/namespaces.html
find the scene node interface and find the function that returns you position, press on the return value and it will open up documentation for that value type. Or just find vector class in documentation.
Working on game: Marrbles (Currently stopped).
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: get to get the xPosition of an object

Post by 804 »

Just say which function I should use :D

PS: What do you think about the images?
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: get to get the xPosition of an object

Post by serengeor »

I can't see the images, and you there's no function to get them and theres no need since pos values are public members.
http://irrlicht.sourceforge.net/docu/cl ... tor3d.html
Working on game: Marrbles (Currently stopped).
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: get to get the xPosition of an object

Post by 804 »

serengeor wrote:since pos values are public members.
Sorry, I don't knew this.
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: get to get the xPosition of an object

Post by 804 »

whats the name of these variables ?
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: get to get the xPosition of an object

Post by serengeor »

Just look at the API doc, It's going to be a nightmare for you if you can't read doc of api of the library that you're using to develop you project with..
Working on game: Marrbles (Currently stopped).
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: get to get the xPosition of an object

Post by CuteAlien »

Sorry, you can't post images in your first post (protecting our users from occasional spam-images).
But serengeor gave you already the correct link for vertex documentation - check the Public Attributes section until you find some variable which looks like it could stand for the 'x' part of a vector ;-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: get to get the xPosition of an object

Post by 804 »

Code: Select all

core::vector3df::X
But how to get the position of my object?

PS: I posted the links to the images in my first reply.
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Re: get to get the xPosition of an object

Post by Adler1337 »

node->getPosition().X;
:roll:
PS: Still can't see your images.
multum in parvo
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: get to get the xPosition of an object

Post by 804 »

///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: get to get the xPosition of an object

Post by 804 »

Can you See the links!
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: get to get the xPosition of an object

Post by mongoose7 »

Der Zutritt zu dieser Seite ist Ihnen leider verwehrt. Sie besitzen nicht die notwendigen Zugriffsrechte, um diese Seite aufrufen zu können.

I think you have to have a login?
Post Reply