Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

are voxels limited to positive x y z?

My experiments appear to say that anything < 0 is ignored but it could be something in my camera setup.

If they are limited to positive coordinates, is that written down somewhere? I'm really fumbling even more than usual with the voxel stuff. :)

thanks!

Comments

  • dave1707dave1707 Mod
    edited February 26 Posts: 8,193

    @RonJeffries I’ve tried different things, but I can’t get a Voxel to show using negative coordinates. I haven’t played with voxels that much, so I might be missing something.

    PS. I don’t think the coordinates can go negative. When you create a Voxel, you’re creating something in the Voxel terrain. When you create the terrain area, you’re specifying positive values. So if you’re Voxel has negative values, you’re outside the valid Voxel terrain area and it doesn’t show.

  • so it seems,yes, thanks

  • dave1707dave1707 Mod
    edited February 26 Posts: 8,193

    @RonJeffries Heres an example showing that you can’t go negative. This starts with a Voxel sphere of radius 10 at position 10,10,10.

    Run this to show the full sphere.

    Comment out sphere line 1 and uncomment line 2 and run it. Part of the sphere is cut off.

    Comment line 2 and uncomment line 3. Run it.

    Then comment line 3 and uncomment line 4. Run it.

    As the sphere moves closer to 0,0,0 the parts that go negative don’t show.

    PS. Slide you finger to rotate the image.

    displayMode(FULLSCREEN)
    
    function setup()
        assert(OrbitViewer, "Please include Cameras (not Camera) as a dependency")
        scene = craft.scene()    
        viewer = scene.camera:add(OrbitViewer, vec3(0,0,0), 200, 0, 1000)    
        entity=scene:entity()
        scene.voxels.blocks:addAssetPack("Blocks")
        water = scene.voxels.blocks:new("Water")
        water.setTexture(ALL, "Blocks:Water")   
        scene.voxels:fill("Water")
        scene.voxels:resize(vec3(3,1,3))          
        scene.voxels.coordinates = vec3(0,0,0) 
    
    
        scene.voxels:sphere(10,10,10,10)        -- 1
        --scene.voxels:sphere(10,10,0,10)       -- 2
        --scene.voxels:sphere(10,0,0,10)        -- 3
        --scene.voxels:sphere(0,0,0,10)         -- 4    
    end
    
    function update(dt)
        scene:update(dt)
    end
    
    function draw()
        update(DeltaTime)
        scene:draw()
    end
    
  • Posts: 1,605

    @dave1707 @RonJeffries - couple of things
    - are you sure the model is doing what you say it looks like there is a full sphere with part of another sphere attached.
    - @Simeon - is Craft fully compatible with the new asset system? I changed “Blocks:water” to asset.builtin.Blocks.Water (without speech marks) and it fired up an error. I tried adding speech marks to the asset... and it just produced an environment box with no object present. Does this require a modified syntax?

  • dave1707dave1707 Mod
    edited February 26 Posts: 8,193

    @Bri_G Just use one of the scene.voxel:sphere lines at a time. When you uncomment one line, make sure the other three are commented. Each line moves the sphere closer to the center of the screen and the edge of the terrain area. As the sphere moves towards the edge of the terrain area, it get chopped off because the Voxel can only be in the positive area.

  • SimeonSimeon Admin Mod
    Posts: 5,202

    @Bri_G unfortunately not, the voxel system is very tied into the idea of named asset packs and builds its own internal atlas from the given name. So you need to continue to use the old syntax ("Blocks:Water") for voxels at the moment

  • JohnJohn Admin Mod
    Posts: 603

    I'll have a look into updating voxels to use the new asset system. @Simeon is right in the sense that it was built under the assumption of the old string-based one.

    Negative coordinates aren't supported so the general idea is to start in the middle of the voxel world if you want an equal amount of area on either side.

  • edited February 27 Posts: 496

    great! i was afraid i had some other issue. there may be a good place to mention that in the docs. thanks!

Sign In or Register to comment.