Jump to content
The Dark Mod Forums

Discrepancy if applying a scaling factor to rotation matrix


Recommended Posts

I created a model and put it into my map. Since this model is a pole, I wanted it to be larger then modeled, because it has to be used in a variety of sizes and I don't want to model it in all kind of lengths.

 

My first attempt was to apply a scaling factor in the matrix, which worked in DR, and the model got longer because of that. However, when I loaded the map in D3 the length was not applied, so it seems that D3 adjusts such values. Maybe this should also be done in DR? This could be achieved by clamping the absolute values between 0 and 1.

Gerhard

Link to comment
Share on other sites

In principle I agree with you, but the problem I see is that it "works" in DR, and I assume that the editor for the maps would give me a reliable representation of the map as it will look in the game. As I said, if you clamp the values between 0..1 and keep the sign, it should be safe. You don't need to change the actual values, because D3 doesn't seem to do it as well. Only clamping the values while calculating the views should be enough.

Gerhard

Link to comment
Share on other sites

Is the goal to disable the ability to use the rotation size hack? It does work in game (I've done it with DoomEd), but I believe it can be hard to get just right. If it's not really causing any problem, why disable a feature that can be useful? But maybe I'm misunderstanding the post.

Link to comment
Share on other sites

Do you have an exmaple where it worked? Getting it right is not the issue. I adjusted the value so that it was right. Since I only had one axis where I wanted to adjust the size, this was quite easy to do. But when I load the map in Doom 3 the model has it's original size, so I figured it ignores that. I seem to remember that ascottk did this successfully somehwere, but I thought that this was not with the rotation parameter.

 

I can create a testmap and make a comparison, to make sure. Mathematically it should work, so if it doesn't then it means that Id disabled this intentionally for some reason.

Gerhard

Link to comment
Share on other sites

@spar: Not a specific example built right now, but I recall resizing a table to be huge when we discussed it in another thread about this topic, long ago. There were some difficulties getting it right, and once I rotated the object in the editor, the scaling broke.

 

Hm. I wonder if they could have changed something with the patch?

 

@greebo: Yep, I believe so. In that case, rotate your model as you want it, do the scale hack, and then build a clip brush around it. *shrug*

 

Anyway, I just meant that we could always just leave it alone, leave it unsupported, rather than actually disabling it... it's got some use afterall.

Link to comment
Share on other sites

If you use it for static objects that are outside accessible areas, tehn it should work. Might save some time, because you can reuse existing models in that case, but I guess that use is pretty limited. I will test this tonight though, and see if this really works or not. If this is clamped in the SDK code, then it must be done somewhere, so we should be able to find it. Mathematically it should work, because this matrix is nothing special. It's an effect of using these matrix operation, so you would have to specifically disable it as no extra code would be required to support it. I wonder why they don't apply the same rotation matrix to the climodel though. This would solve all issues, and IMO the climodel has to be aligned with the model anyway.

Gerhard

Link to comment
Share on other sites

Just tried this out, and it works fine. I created two tables and scaled them with the rotation hack. The first image is after building the map in DoomEd and applying the scale to the first table, compiling, and then viewing it in Doom3. The second image is after closing, reopening the map in DarkRadiant, applying the scaling to the second table, saving, recompiling, and launching it in Doom3 again.

 

tablesed9.th.jpg

Link to comment
Share on other sites

The clip brush stays where you placed it. It's not related to the model. Only the climodel should be shrunk with the model, but apparently that's not the case. Don't know why, because IMO you would just have to apply the rotation matrix to the climodel as well. Maybe they skipped that part for performance reason and just copied the clipmodel to the same position, but I don't see how that should work.

Gerhard

Link to comment
Share on other sites

It's annoying that T3Ed was the same way. There's got to be some programmatic reason behind it I assume, that they'd go through the work to allow for a visual size hack, but not go ahead and resize the collision info, too. It's a shame. Although, probably fixable at code release...

Link to comment
Share on other sites

There is no work involved to allow the size hack, it is an accident of using a matrix to represent rotation since a matrix can also represent translation, scaling or shearing.

 

I have no idea why the clipmodel is different though, you'd think if the matrix applies to one it would apply to both.

Link to comment
Share on other sites

  • 1 month later...

Can someone explain to me exactly how to do this please? Specifically I need some large wrought iron gates so I want to enlarge the model provided then add an unrendered brush to block the player. The gates are purely decorative and will not be opened in game. But I can't find anything about rotation parameters nor do I understand how to do this tweak.

Link to comment
Share on other sites

Thanks SD, Is there any way to change the height and width separately? I've been experimenting all afternoon and got double width and once I saw double height but lost my setting! Also got thicker railings in the gate for the same size gate! :laugh:

 

[EDIT] Hang on - I think 1 0 0 0 1 0 0 0 3 might be what I want. I'll experiment more later. Many thanks.

Link to comment
Share on other sites

Got it. thanks. What delayed me earlier was you don't even see the rotation values until you use the rotate tool and then you see something like 0.100146 -0.528522 -0.842992 -0.363242 0.769351 -0.525504 0.926297 0.358838 -0.114934 so it was not clear what did what.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 2 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...