Author Topic: nGL - a fast (enough) 3D engine for the nspire  (Read 270295 times)

0 Members and 1 Guest are viewing this topic.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #315 on: June 03, 2014, 01:41:41 pm »
I guess it depends on what you mean. If it means "currently placed doors won't work, you have to (and can) remove them and place them back to fix it", I guess it is ok. If it means "forget about doors, they will not be part of that game", I guess it is less ok.
At worst, couldn't you do a smart but not intuitive enum that would make both powered blocks work and doors work ? Like, if your door is currently 01xxxxxxx, then do
10=passively powered
00=actively powered (not intuitive)
11=not powered
01=not powered either
This way, the door isn't powered and 01xxxxxx is still available for it ;)
And no one cares about that door not being powerable, I don't think doors are powerable in Minecraft. I think the best you can do is open them if the block next to them is powered.

Now that I think of it, even a more intuitive enum like
11=actively powered
10=passively powered
01=not powered
00=not powered either
could work...
« Last Edit: June 03, 2014, 01:52:08 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #316 on: June 03, 2014, 01:56:58 pm »
It's not that big of a problem ;)
Currently, BLOCK_WDATA is defined as uint16_t, the lowest 8 bits are the BLOCK (the ID),
the higher 8 bits could be used for anything.
Somewhere in crafti, there's the enum BLOCK_SIDE, which is used as the highest 8 bits of the door's BLOCK_WDATA.
To indicate whether it's the top or bottom half of a door, bit 7 is used.
For redstone power state, I'd use the top 2 bits (7 and 6) and I'd have to move the door part bit out of the way.
Then each door part would have it's part bit set to 0, which is bottom..

Edit: So that old doors won't confuse redstone circuits:
enum  REDSTONE_STATE {
NOT_POWERED=0b00,
PASSIVELY_POWERED=0b01,
NOT_POWERED_2=0b10,
ACTIVELY_POWERED=0b11,
}; or even better, a bitfield.
« Last Edit: June 03, 2014, 01:59:15 pm by Vogtinator »

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #317 on: June 03, 2014, 02:23:03 pm »
Doors are openable in Minecraft. This allows automagically opening them. ;)

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #318 on: June 03, 2014, 02:45:12 pm »
I did a quick test:
This monstrosity can only be opened with the real bottom part..

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #319 on: June 03, 2014, 03:49:22 pm »
Why do you need bits for opened or closed doors? Can't you just make a block which is an opened door and an other one which is a closed one ?



Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #320 on: June 03, 2014, 04:05:42 pm »
Does it matter where the bit is? In the BLOCK_DATA or BLOCK (number)?

Offline GinDiamond

  • LV3 Member (Next: 100)
  • ***
  • Posts: 71
  • Rating: +2/-2
  • I dont always fail at life, but when I do, I dont
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #321 on: June 03, 2014, 04:10:28 pm »
So freaking cool. Keep up the amazing work man!

Offline bb010g

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 428
  • Rating: +22/-1
  • I do stuff
    • View Profile
    • elsewhere on the net
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #322 on: June 04, 2014, 09:41:29 am »
It's not that big of a problem ;)
Currently, BLOCK_WDATA is defined as uint16_t, the lowest 8 bits are the BLOCK (the ID),
the higher 8 bits could be used for anything.
Somewhere in crafti, there's the enum BLOCK_SIDE, which is used as the highest 8 bits of the door's BLOCK_WDATA.
To indicate whether it's the top or bottom half of a door, bit 7 is used.
For redstone power state, I'd use the top 2 bits (7 and 6) and I'd have to move the door part bit out of the way.
Then each door part would have it's part bit set to 0, which is bottom..

Edit: So that old doors won't confuse redstone circuits:
enum  REDSTONE_STATE {
NOT_POWERED=0b00,
PASSIVELY_POWERED=0b01,
NOT_POWERED_2=0b10,
ACTIVELY_POWERED=0b11,
}; or even better, a bitfield.
You could use the free 8 bits for power level.
Arch Linux user
Haskell newbie | Warming up to Lua | Being dragged into C++
Calculators: HP 50g, HP 35s, Casio Prizm, TI-Nspire CX CAS, HP 28s, HP Prime, Mathematica 9 (if that counts)
π: 3.14...; l: 108; i: 105; e: 101; l+i+e: 314
THE CAKE IS A LIE IS A PIE

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #323 on: June 04, 2014, 10:04:56 am »
Which 8 free bits?

Edit: First test of some basic redstone
« Last Edit: June 04, 2014, 02:36:52 pm by Vogtinator »

Offline GinDiamond

  • LV3 Member (Next: 100)
  • ***
  • Posts: 71
  • Rating: +2/-2
  • I dont always fail at life, but when I do, I dont
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #324 on: June 04, 2014, 06:25:17 pm »
can you imagine, redstone computers on your Nspire?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #325 on: June 04, 2014, 09:10:45 pm »
can you imagine, redstone computers on your Nspire?
Better, a redstone calculator on your calculator O.O.

Offline GinDiamond

  • LV3 Member (Next: 100)
  • ***
  • Posts: 71
  • Rating: +2/-2
  • I dont always fail at life, but when I do, I dont
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #326 on: June 05, 2014, 06:33:40 am »
*mind blow*

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #327 on: June 05, 2014, 07:23:35 am »
Yo dawg, so I heard u like calculators so I build a calculator in yo' calculator so you can calculate while you calculate.
* Streetwalrus runs

Offline bb010g

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 428
  • Rating: +22/-1
  • I do stuff
    • View Profile
    • elsewhere on the net
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #328 on: June 05, 2014, 09:50:11 am »
Which 8 free bits?
It's not that big of a problem ;)
Currently, BLOCK_WDATA is defined as uint16_t, the lowest 8 bits are the BLOCK (the ID),
the higher 8 bits could be used for anything.
Arch Linux user
Haskell newbie | Warming up to Lua | Being dragged into C++
Calculators: HP 50g, HP 35s, Casio Prizm, TI-Nspire CX CAS, HP 28s, HP Prime, Mathematica 9 (if that counts)
π: 3.14...; l: 108; i: 105; e: 101; l+i+e: 314
THE CAKE IS A LIE IS A PIE

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #329 on: June 05, 2014, 02:40:19 pm »
They're not free for doors:
Quote
Somewhere in crafti, there's the enum BLOCK_SIDE, which is used as the highest 8 bits of the door's BLOCK_WDATA.