What feeds 23.SMeshHandling eggbox function?

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.
Post Reply
renter
Posts: 3
Joined: Tue Mar 03, 2015 3:38 pm

What feeds 23.SMeshHandling eggbox function?

Post by renter »

In tutorial example 23.SMeshHandling there is a function f32 eggbox(s16 x, s16 y, f32 s) on line 57. It gets referenced on lines 353 and 400 however the call is just hm.generate(eggbox);
How does this work?
Where does x y and scale come from?
Also I modified function eggbox to simply return .01*y; but I get a weird stutterstep on my graph. Can anyone explain why?
Also Where is the for loop generated here? Thank you
Image
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: What feeds 23.SMeshHandling eggbox function?

Post by CuteAlien »

I just looked a little bit around where this example is coming from. Seems it's from this thread: http://irrlicht.sourceforge.net/forum/v ... 99#p174399

Maybe you find some info in there.
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
renter
Posts: 3
Joined: Tue Mar 03, 2015 3:38 pm

Re: What feeds 23.SMeshHandling eggbox function?

Post by renter »

I see what they are doing with the eggbox now. They are passing it as a variable into calc(). So according to that link you shared I also need to make sure I always set my indices like 269 - 281. I am still confused about where the flat part in my graph is coming from.


[EDIT] Its because y = 0; So return .01*y; will return 0 for all points of the 2 triangles resulting in a flat surface.
Post Reply