Itoo Software Forum

Author Topic: Problems with the z-axis  (Read 1323 times)

RD3460

  • Newbie
  • *
  • Posts: 6
Problems with the z-axis
« on: May 04, 2014, 04:17:02 AM »
Hello,

I'm new to Forest Pro and I'm trying to setup my billboards right to use in the game I'm working on, rFactor 2.

I have my reference objcets setup right, they export fine and work fine in game, and also worked fine with the scatterer I was using prior to using Forest Pro.

However, I cannot get them to work right with Forest.  It seems to create the quads itself, instead of use the reference object as it is.  So my axis ends up wrong, and the vertex alpha, which needs to be anything but 100% for the billboard effect to happen in game.  This allows having non billboard and billboard quads in the same object.

I tried adding my mesh objects, simple quads, already setup right to the library and use them from there, and it doesn't work, and I also tried switching to the same objects, imported in my test scene, and the same thing happen.

I first thought it was working right with the objects in the scene, but it didn't, the same thing happens.  The axis, which need to be z up, y back, x right, seeing the plane from front view.  They end up z front, x down and y right.

Any ideas on what to do?  My previous scatterer had an option to set which axis to use for up direction, so it was easy, and it could also use the same as the reference object too (in other word, keep it)...  I cannot seem to find such an option in Forest, the only thing regarding direction is the little direction rollout ,but it doesn't help.

Thanks in advance for helping me find a solution.

RD3460

  • Newbie
  • *
  • Posts: 6
Re: Problems with the z-axis
« Reply #1 on: May 04, 2014, 06:05:48 AM »
I fiddled some more, and found something...

Here are the steps I used before:

I had saved my sample grass tuft billboards in a separate max file, and imported into forest library.  Then I created a forest with the 8 different tuft of grass I had there.

The result, once I converted to poly and set the vertex alpha back to 99.9, the tuft were displayed upside down in game.

I then tried to use the same reference objects, but coming from the same test scene, clicking the object button and replacing each manually with the same one found in the scene.  This resulted in the same behavior.

I then remembered I had seen an import custom object button in the lite, and decided to try this.  I imported this way the 8 tuft of grass, and delete the other 8.  Converted, set the vertex alpha, and bam, in game it worked just right.

But I would really like to use the library in forest.  Any possiblity for a up-axis setting in Forest, so we could set which axis it should use as up, and let us invert it, if we need up or bottom.  That would be awesome.


iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3156
    • iToo Software
Re: Problems with the z-axis
« Reply #2 on: May 04, 2014, 09:08:43 AM »
Sorry, but i'm not sure if i understand well the problem: Forest can use predefined billboards (Template option), or Custom Objects. In this case, the object is taken from the scene as it, and aligned with the terrain with Z axis up. So, there is not any reason to be displayed upside down in game, except if there is some problem in the exporting/importing process.

Please, would you send us a test scene and some screenshots ? How do you export Forest to the game ?
It would be very helpful if we can reproduce the process here.

Thanks,
Carlos Quintero
iToo Software

RD3460

  • Newbie
  • *
  • Posts: 6
Re: Problems with the z-axis
« Reply #3 on: May 04, 2014, 02:36:23 PM »
Greetings Carlos,

Well... strange things happen.  These darn billboards will end up getting the best of me!  It took me a while to get them right in game (when I first started this) and it had been a while I didn't had any problems with them either.

I wanted to reproduce the problem this morning, so first thing I did was take a screenshot of the grass working right as I got it yesterday.  Then I did the same steps I did yesterday to create the upside down grass.  Added a new forest with the objects I defined in the user library, except much less density to speed up exporting, and when I got in game, the grass was fine. 

I'm puzzled.  Really, I have no idea what was going on. 

If I end up reproducing the problem again, I'll take screenshots and I'll let you know.

As a matter of fact, yesterday, I also tried to replace the quads mesh with 1 quad billboard template from forest and reduce the defaut size down, and it resulted in the same behavior, it was upside down.

My exporter settings haven't changed either.  The way I export the forest object, I first convert to edit mesh, then poly, then I set back my vertex alpha to 99.998 (it needs to be anything but 100% to enable the billboard effect on the quads you want), and I export it with a custom plugin from ISI, that convert the mesh to gmt's.

On this matter, I also noticed that Forest also resets the vertex alpha on custom objects added from scene.  It would be really nice if Forest didn't touch the vertex alpha, as it would end up saving me a great deal of time over the whole terrain.


RD3460

  • Newbie
  • *
  • Posts: 6
Re: Problems with the z-axis
« Reply #4 on: May 04, 2014, 02:38:01 PM »
But what I was asking to make sure this doesn't happen again, is a setting in Forest, that would let us tell Forest which axis should it use as the up axis.  Some games needs z, some needs y....  that's why I'm asking this.


RD3460

  • Newbie
  • *
  • Posts: 6
Re: Problems with the z-axis
« Reply #5 on: May 04, 2014, 09:47:07 PM »
Just to let you know I have sorted out my issues.

Think it might have been a reset xform issue, I'm not exactly sure, but things works out fine now.

At first, I had many crashes in Max, but after re-importing in a new max file, things seems to be more stable.

I also want to thank you for making Forest, it is nothing short of amazing.  I will probably be able to send a few suggestions your way as I use it. 

Many thanks, it was my most expensive purchase for this project, but given the track, it is well worth it.... the track was made 10+ years ago, and trees are scarce, when it should be the green hell (Nordschleife).  So I'll fix this up and instead of using cheap horizontal tree line to fill in where forest would be, I'll fill it with actual forest!  My first patch I did looks pretty good, and I'm getting better with it too.  The presets are really useful!  I did the second patch really quick with it. 

I'll be sending some screenshots to show some before and after Forest when I'm done or nearly done...


RD3460

  • Newbie
  • *
  • Posts: 6
Re: Problems with the z-axis
« Reply #6 on: May 04, 2014, 09:50:12 PM »
Hmm, I might add tho, things work out fine with the objects imported in the library or the custom list button. 

However, if I use the template from Forest, the trees end up 90 CCW... so the trunk is sticking out to the right.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3156
    • iToo Software
Re: Problems with the z-axis
« Reply #7 on: May 05, 2014, 08:58:42 AM »
Glad the problem is sorted out. Regarding templates, probably that happens because the order or the vertices in the mesh used as model.
You can modify them editing the following file C:\Program Files (x86)\Itoo Software\Forest Pack Pro\geometry\objects\geometry1.max. You will find one object by template type.

Take care this file is overwritten by Forest updates, so make a copy of your changes. Alternatively, it's possible to define new templates editing the text file "index.dat", which is in the parent folder. i hope that helps.

I will look the vertex alpha issue and post again.

Edit: i confirm Forest doesn't keep the vertex alpha channel in the generated mesh. Added to the to-do list.
« Last Edit: May 06, 2014, 10:36:39 AM by iToo »
Carlos Quintero
iToo Software