News | Forum | People | FAQ | Links | Search | Register | Log in
Mapping Help
This is the place to ask about mapping problems, techniques, and bug fixing, and pretty much anything else you want to do in the level editor.

For questions about coding, check out the Coding Help thread: https://www.celephais.net/board/view_thread.php?id=60097
First | Previous | Next | Last
#15165 
You will never get on-grid "rotated" objects to have the same size as their ortho-axis counterparts. The best you can do for 45-degree stuff is to use the rule "3-diagonal units is roughly 4 orthogonal units" - using that rule the stuff you build at 45 degrees will be about 1.06 x larger than the equivalent orthogonal structure.

Because it's a pain in the arse to build at 45 degrees, do this:

Build your structure as normal, non-rotated, making sure nothing in it goes below a grid size of 4.

Then, in the two axes that are *not* going to be your rotation axis, scale your structure by 1.0606601717798212866012665431573 (I just c'n'p that from calculator)

Then rotate the whole thing 45 degrees

at this stage, it should look on grid (grid 1), but snap it all to grid 1 to be sure.

Note that with modern compilers, it's very debatable whether you even need to be on-grid anymore - personally I think on grid is only important so that other things can be fitted together neatly. 
Kinn 
Nice!

Reminded me of the old Prince Rupert's cube problem. 
Fantastic Advice, Thank You, Kinn! 
 
 
...and thanks for that link, mfx. That makes my brain hurt. :) 
Yep 
Also, you can use the same idea to make stuff that's rotated at other angles, (e.g. ~27 degrees which sits on a 1:2 gradient, or ~14 degrees which sits on a 1:4 gradient)

The trick is to use simple trigonometry to work out the difference in scale between the non-rotated brush and the closest-size rotated brush that's still on grid, then to apply this scaling to your object before you rotate it. 
Thanks, That's Great Advice! However... 
The trick is to use simple trigonometry

Yeah, that's the problem. I can barely remember any high-school mathematics. Very basic geometry and trigonometry seem about as simple as string theory to me at this stage. 
Ok I'll Rustle Up A Picture To Show It 
 
That'd Be Brilliant, Thanks! 
 
 
You can't make most 45 degree rotations be on the grid.

Let's assume a 64 unit x 64 unit square (we're only considering top down view). The diagonal of that square is 90.509... units ( Sqrt(64^2+64^2) ), and thus will not be on the grid when you turn it 45 degrees.

If you want to be on the grid with your rotation, you basically need to sacrifice perfection and actually scale your cube up or down as you rotate so as to get the corners on the grid, which is essentially what you are doing when you build a 45 degree cube by hand on the grid at a 45 degree angle.

Here's an example from some rotated cubes. I built these on the 8 unit grid, rotated the texture 45 degrees and used Radiant's fit tool to get the precise texture scale. Notice how the top one is slightly bigger than 1x1 scale, and the lower is slightly less. That means this cube itself is slightly bigger or smaller than the normal 64x64 cube next to it... but it's close and most wouldn't notice the difference. A perfectly rotated cube would be a 1x1 texture scale (or close due to slight rounding), but would not be on the grid.

---

As a side note, if you want to know how to scale the texture without the fit tool: The rotated cube on top is 96x96 on it's diagonals, we need half that to figure the length of one side (we're making a right triangle): Sqrt(48^2+48^2) is 67.882... We divide that by the size of our texture, 64, and get 1.06066..., just like the fit tool gave us! 
THANKS FOR STEALING MY THUNDER KINN 
 
Directional Music 
I tried multiple entities in FMB-BDG and never managed to get away from stereo sound for the music. Most of the time it wasn't an issue as other sounds were always going off. But if you stand in a quiet area and pirouette, apart from the ogres making snyde comments, you get a distinct phasing effect. 
Lmoa Scampie - Thread Refresh FAIL 
Anybeans - here is a picture I made to show the basic theory behind building things to follow arbitrary gradients - note that they will typically only be approximately the same size as their orthogonally built versions, but it's worth it just to make things all line up neatly on grid.

http://i.imgur.com/XHRW16V.png

You can have fun working out the scale relationships for different gradients - I will leave that as an exercise for the reader. 
Important Note 
The important thing to remember is that the original ortho-built geo needs to be on a coarser grid than the target rotated geo - you have to think how the ortho grid maps to the rotated "pseudo-grid" - e.g. for 45 degrees, 4 ortho grid units maps to "3 up and 3 along" grid units, so the original geo can't be built on a grid lower than 4.

For a ~27 degree rotated object (so the geo follows a 2:1 gradient), like the picture I just posted, 2 ortho grid units maps to "2 up and 1 along" grid units, so you only have to make sure the original isn't built on lower than grid 2. 
Genius! 
 
Cheers, But I Think Czg Was The Pioneer. 
See czg's Honey? Those crazy rotated broken bridges were built using this method, but the scale-then-rotate technique was applied twice in succession- in different axes - to get them looking really funky.

If you are going to rotate an object like this twice, the coarseness of the grid of the original object needs to be even higher - again I will leave that as an exercise for the reader. 
Brilliant 
Thank you, Kinn.

And thank you, Scampie. 
You Should All Look At Czg's Curves Again 
 
A Rotatable Grid 
Is on my todo list for TB 2.1. That would make such things a lot simpler. 
Skyboxes 
Been looking for these handsome skyboxes you guys been using. Only found a graveyard of broken links (poetic). Where are they? Where are the coolest skyboxes these days? 
Swapping Between Multiple Info_intermissions 
From post #730 I see that a map allows a maximum of 4 different info_intermissions. Does the camera swap between them depending on engine (EzQuake / DarkPlaces seems not to) or is there a way that I can cause the view to autoswap every x seconds? (spz1dm2ftk in Screenshots & betas is the basic map but way out of date detail wise by now) 
Adib 
Adib 
Info_intermission 
Quake's normal qc code just 'randomly' chooses between the cameras (technically it's bound to your playtime, but for all intents and purposes, random). You can't, outside a mod, change which it chooses or make it swap to a different one every so often. 
Mfx 
Yes, I've seen lvl and Simon's skies. And I used Terragen about 10 years ago, it was awesome already. I just don't have time to make one for Jam6. I've seen people posting "look, my new skybox" and got curious, wanted to see something different. But thanks for mentioning Terragen. 
Adib 
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.