SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 12-18-11, 02:26 AM   #286
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Implemented picking. Currently you can 'pick' a mesh on the screen by double clicking it's bone origin and:
- render is set so solid or solidwire
- lighting is disabled

I will convert it over to just being able to double click the mesh itself but I just wanted to see if my idea worked or not. The stipulations of render set to solid or solidwire and lighting disabled will still hold

The item 'picked' will turn a beige color and the meshes tab will show the item as the currently selected item. If you select another item in the meshes tab then the currently 'picked' item will change to the item selected. A message is posted in the status box letting you know that you 'picked' a mesh:


Double click an empty part of the screen to 'unpick'.

I will implement picking for verticies also so I can implement the ability to edit/change verticies of a mesh. I will have it coded that in order to 'pick' a vertice you have to be in a render mode that has points (because each point is a vertice).
TheDarkWraith is offline   Reply With Quote
Old 12-18-11, 10:11 PM   #287
TheBeast
The Old Man
 
Join Date: Jan 2010
Location: Lynnwood, WA
Posts: 1,533
Downloads: 876
Uploads: 23


Default

Quote:
Originally Posted by TheDarkWraith View Post
I loaded the Uboat_Sensors file in the app and was able to move bones around. So in order to figure out why you're having problems I need to use the file you tried.

I did though find errors in the code that handles the TreeView for these bones. To draw the TreeView the code does this:

for every file (app has ability to have more than 1 GR2 file loaded though that feature is currently disabled)
- draw a node and update file index counter
---- for every model in the file (you see this as skeleton since models only have 1 skeleton)
----- draw a node and update model index counter
-------- for every bone in the model (skeleton)
--------- draw a node and update bone index counter

Problem was I was never resetting the model or bone index counters whenever a new model or file was used! I have corrected the problem and will be available in next version
The File I was trying to edit was the data\Submarine\NSS_Uboat7b\Submarine Parts\Conning_7B_00.GR2 file.
__________________
Fear me! I am, TheBeastBelow

SHIV-MediaFire | SHV-MediaFire
TheBeast is offline   Reply With Quote
Old 12-19-11, 02:05 AM   #288
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

have all the picking done. You can select an object by double clicking on it.

If a render mode contains solid then double click any object.
If a render mode conatins solid and you have bones enabled then you have to double click the bone origin to select the object
If a render mode contains points then double clicking a point will select the vertice.

Now for the fun part: use the mouse to drag/rotate the object/vertice to it's new position/rotation You can now deform the mesh by dragging verticies to new positions.

I currently have one problem that is a matrix problem that I can't figure out. It deals with rotations. Say you double click the funnel on top of the King George V. Now you yaw the mesh 90 degrees. Now let's say you want to pitch the mesh 90 degrees. What should happen is it pitches on it's yawed coordinate system (since we yawed it 90 degrees +x is now where +z was and +z is now facing down -x). But I can't make this happen. I've tried to figure out how to do this but keep running into a ro*******. I have everything working except for this

more to come...
TheDarkWraith is offline   Reply With Quote
Old 12-19-11, 02:49 PM   #289
MLF
Weps
 
Join Date: Sep 2002
Location: SW France
Posts: 361
Downloads: 137
Uploads: 0
Default

Sorry to be dumb. Keep getting

Exception is:
Error in the application. *********
********* Exception while presenting

I've had this with all the latest versions. Set SH5 path to top level SH5 directory (one above data) as in screenshots. Whatever GR2 file I try opening I get the error.

Any help would help.

MLF
__________________
Je pense donc je fuis!
MLF is offline   Reply With Quote
Old 12-19-11, 03:26 PM   #290
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by MLF View Post
Sorry to be dumb. Keep getting

Exception is:
Error in the application. *********
********* Exception while presenting

I've had this with all the latest versions. Set SH5 path to top level SH5 directory (one above data) as in screenshots. Whatever GR2 file I try opening I get the error.

Any help would help.

MLF
If you don't have any GR2 files open can you rotate the camera with the mouse without error? Does that problem only happen when a GR2 file is loaded?

Figured out my matrix problem After sleeping on it I woke up realizing that I had to treat each axis of the selected object's rotation offset individually. Think of it like camera control - you compute a rotation matrix for each axis based on a combination of up, look, and right vectors. When you want to rotate the camera you change the up, look, and right vectors then compute the new viewmatrix. Well instead of it being a viewmatrix it's a rotation offset matrix. Ah the simple things allude us sometimes...
TheDarkWraith is offline   Reply With Quote
Old 12-19-11, 04:22 PM   #291
MLF
Weps
 
Join Date: Sep 2002
Location: SW France
Posts: 361
Downloads: 137
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
If you don't have any GR2 files open can you rotate the camera with the mouse without error? Does that problem only happen when a GR2 file is loaded?
Yeah - I can rotate the camera (position and Rotation) no problems.

When I load up the editor the status panel shows:-

Silent Hunter 5 GR2 Editor/Viewer v1.0.429.0 by TheDarkWraith
Reading in cfg file...
DirectX initialized
SH5 install path set to E:\SH5

Then try loading, for example, Bunker.gr2 and :-

Silent Hunter 5 GR2 Editor/Viewer v1.0.429.0 by TheDarkWraith
Reading in cfg file...
DirectX initialized
SH5 install path set to E:\SH5
GR2 file path is E:\SH5\Data\Terrain\Locations\bunker.gr2
********* Exception while presenting
Exception is:
Error in the application. *********
********* Exception while presenting
Exception is:
Error in the application. *********

Directx Version = 9.0c 4.09.0000.0904

Thanks for all your work on this application.

MLF
__________________
Je pense donc je fuis!
MLF is offline   Reply With Quote
Old 12-19-11, 04:30 PM   #292
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by MLF View Post
Yeah - I can rotate the camera (position and Rotation) no problems.

When I load up the editor the status panel shows:-

Silent Hunter 5 GR2 Editor/Viewer v1.0.429.0 by TheDarkWraith
Reading in cfg file...
DirectX initialized
SH5 install path set to E:\SH5

Then try loading, for example, Bunker.gr2 and :-
Yes I noticed that problem with the bunker in the last version. I have fixed that in upcoming release. Try and see if you can load the King George V. Then try a sub.

I'll have the new version ready here soon
TheDarkWraith is offline   Reply With Quote
Old 12-19-11, 04:46 PM   #293
MLF
Weps
 
Join Date: Sep 2002
Location: SW France
Posts: 361
Downloads: 137
Uploads: 0
Default

Hi TDW,

I have tried Bismark, KG5, Scharnhorst, Hipper..... usw usw.

Same result.

regards

MLF
__________________
Je pense donc je fuis!
MLF is offline   Reply With Quote
Old 12-19-11, 05:06 PM   #294
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by MLF View Post
Hi TDW,

I have tried Bismark, KG5, Scharnhorst, Hipper..... usw usw.

Same result.

regards

MLF
Are you using shaders or the fixed-function pipeline for rendering? On the Rendering tab switch it to Fixed. Disable lighting. Disable bones (On bones tab in the bones box uncheck Show). On the FillMode tab select Solid and uncheck Texture. Close the app down File-->Exit. Then restart app. This way the cfg file is updated with the changes when you restart the app.

You probably had it set to shaders and are missing the \Shaders folder or it can't find the shaders folder and/or the .fx files.
TheDarkWraith is offline   Reply With Quote
Old 12-19-11, 05:41 PM   #295
MLF
Weps
 
Join Date: Sep 2002
Location: SW France
Posts: 361
Downloads: 137
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
Are you using shaders or the fixed-function pipeline for rendering? On the Rendering tab switch it to Fixed. Disable lighting. Disable bones (On bones tab in the bones box uncheck Show). On the FillMode tab select Solid and uncheck Texture. Close the app down File-->Exit. Then restart app. This way the cfg file is updated with the changes when you restart the app.

You probably had it set to shaders and are missing the \Shaders folder or it can't find the shaders folder and/or the .fx files.
I changed settings as above but still get the same error - funny, on the earlier versions all was OK. As nobody else is reporting this, must be something with my setup. GR2EditorViewer.exe and GR2EditorViewer.cfg are in the SH5 root folder with the shaders folder coming off that. When I start the app, the shaders compile without errors. Probably something to do with Directx?? Any chance on on a log file being written?

Regards

MLF
__________________
Je pense donc je fuis!
MLF is offline   Reply With Quote
Old 12-19-11, 05:48 PM   #296
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by MLF View Post
I changed settings as above but still get the same error - funny, on the earlier versions all was OK. As nobody else is reporting this, must be something with my setup. GR2EditorViewer.exe and GR2EditorViewer.cfg are in the SH5 root folder with the shaders folder coming off that. When I start the app, the shaders compile without errors. Probably something to do with Directx?? Any chance on on a log file being written?

Regards

MLF
No, I'm not outputting any debug info with this app

Anything change in your system since then? DirectX updated? Microsoft .NET 3.5 installed?
TheDarkWraith is offline   Reply With Quote
Old 12-19-11, 07:54 PM   #297
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Now I need to tell you all about the new changes:



1 = Name of GR2 file opened (has always been there)
2 = Name of object or vertice selected
3 = Camera locked or not. Pressing C will lock/unlock camera. Useful when you don't want to disturb the image accidentally. Also camera has to be locked in order to move/rotate an object/vertice
4 = Coordinate system reference. If no item is selected then this will say Camera. Once an item is selected:
- if camera is not locked then this will say Camera (so you can move the camera around with the item locked)
- if camera is locked then this will say Object. Now you are free to move the item around, rotate it, scale it, etc. with the mouse
5 = Current axis of freedom.
- XYZ means you have all axis available and can move in any direction
- X means only X axis is free to move
- Y means only Y axis is free to move
- Z means only Z axis is free to move
- you can have any combination of the XYZ, i.e. XY, YZ, ZX, etc.
- You can toggle an axis of freedom on/off by:
- for X press X
- for Y press Y
- for Z press Z
Now some may ask what's with this axis of freedom stuff? It's really handy. Say your moving an object and you only want to move it in the Y direction. Disable X and Z axis and you don't have to worry about it moving in any other direction but Y.
6 - This is what the color of the object will turn to when selected. NOTE: if you are selecting a vertice then it will not change color. A lock diamond of this color will appear around the vertice.

The default 4 arrow cursor has changed. Now when the render surface is active (you click on it) the cursor will change from default to a + symbol. This means you are ready to select something. Once an item is selected the cursor will change depending on what axis of freedom you have enabled.

To select an object/vertice double click on it. Once an item is selected an axis origin will appear on it showing you it's orientation in the world. This is needed so you know how to move/rotate the unit.
Note: if you have bones enabled (shown) then you have to double click the bone origin itself to select an object. The object 'tied' to that bone will be selected.

To select objects you must be in a render mode of:
- solid
- solid & wire

To select vertice you must be in a render mode of:
- point
- wire & point
- solid & point
- solid & wire & point

You can select objects/vertice with lighting enabled or disabled. I recommend lighting be disabled so you can see the color change.

Once an object/vertice is selected you are free to change the render mode to anything you want. This is handy for when you select a vertice. After selecting it set the render mode to solid. Now when you drag the vertice around you can see the mesh deform in real time.

By clicking on the Meshes tab you bring up a list of the meshes. When you click on one it will also select the object on the screen (you'll get the color change). This means the object is selected and ready to moved/rotated.

To clear a selection (unselect) press spacebar.

Pressing T will show stats (time it takes to render a frame, number of verticies rendered, number of objects culled)

Pressing H will show the help screen. This help screen is dynamic. It can change based on whether you have an object selected or not and some other things.

There are two screenshots available. Pressing W will take a screenshot of only the rendered 'world' on your screen. Pressing A will take a screenshot of the application itself (everything you see about the app). You get to specify a name and location to save these. NOTE: they can only be saved as .dds files.

These screenshots can be used to take a screenshot of a problem or something you were doing so you can give me more information about it.

I might code in the ability to select a wide range of output formats for the screenshots...

EDIT:
I did. You can save in bmp, dds, jpg, png, or tga format.

more to come...

Last edited by TheDarkWraith; 12-19-11 at 10:00 PM.
TheDarkWraith is offline   Reply With Quote
Old 12-19-11, 10:26 PM   #298
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Nice!


On the sleep on it thing? I know the feeling well!
After several days of mulling it over? I broke the compression of modified GR2 files for SWTOR.
  Reply With Quote
Old 12-19-11, 11:58 PM   #299
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

After testing it out I needed to make another change:



I was repositioning Decal31 from the bunker with the mouse. The mouse has many shared functions on it. This was really annoying sometimes. So I made a way you can turn off certain items the mouse can do. You can let the mouse translate, rotate, or scale by pressing the R, T, or S keys. Number 1 in the screenshot shows that I currently only have Translation (repositiong) turned on.

Number 1 in that screenshot can show:
R - rotations enabled
S - scaling enabled
T - translations enabled
any combination of those letters. These only apply when an item is selected.

2 in the screenshot above allows you to choose the output format for the screenshot files.

3 in the screenshot above is another way you can choose what the mouse can do with the selected item.

4 in the screenshot above is the poster I had framed in the screenshot earlier. It's picture is gone because it's selected (and thus has the selected color). You'll also notice the axis attached to the item that shows it's orientation. I moved it away from the wall using the mouse

Notice in the bottom that it says that the camera is locked (cause I was moving the poster) and it shows the selected object's name: Decals31. It says object because we are using the object's coordinate system for any repositioning/rotating/scaling.

All the axis were available for repositioning/rotationg/scaling (XYZ) and the mouse could only do translations (T) with the selected item.

I also enabled all the help screens. Pressing H will show the one in the top right. Pressing U will show the one in the top left. Pressing M will show the one under it. The M menu shows all the combinations for the mouse. This menu is dynamic based on what you have selected (object or vertice) or not selected.
TheDarkWraith is offline   Reply With Quote
Old 12-20-11, 01:14 PM   #300
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Advanced German technology:



Able to get away in a hurry...


Was getting some CTDs when I would select a vertice to modify. Couldn't figure out why...cryptic message of "Execution engine has encountered a problem". After some in-depth searching on Google and finally at Microsoft's website this can happen if the garbage collecter (this is a managed app) tries to 'collect' while your app is doing something 'heavy'. So I had to force GC collections while the app is trying to figure out what you wanted to select. This results in about a 1-3 second delay from when you double click something to when it shows as being selected. Minor annoyance...
TheDarkWraith is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.