Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when Sprite setRoation3D ,the checkVisibility is not right #20024

Open
cx-github opened this issue Aug 10, 2019 · 4 comments
Open

when Sprite setRoation3D ,the checkVisibility is not right #20024

cx-github opened this issue Aug 10, 2019 · 4 comments

Comments

@cx-github
Copy link

cx-github commented Aug 10, 2019

  • cocos2d-x version:3.17.1
  • devices test on: mac
  • developing environments
    • NDK version:
    • Xcode version:
    • VS version:
    • browser type and version:
    • DESC : the top sprite , checkVisibility return the wrong value
      Steps to Reproduce:


require "cocos.init"

local director = cc.Director:getInstance()
director:setAnimationInterval(1.0 / 60)

local designSize = {width = 1136, height = 640}
local glView = director:getOpenGLView()
if nil == glView then
    glView = cc.GLViewImpl:create("Lua  Test")
    director:setOpenGLView(glView)
end
glView:setDesignResolutionSize(designSize.width, designSize.height, cc.ResolutionPolicy.NO_BORDER)


local scene = cc.Scene:create()
cc.Director:getInstance():runWithScene(scene)

local node = cc.Node:create()
scene:addChild(node)
node:setRotation3D({x = -25, y = 0, z = 0})
local winSize = cc.Director:getInstance():getWinSize()
local spSize = cc.size(500,500)
for i =-1, math.ceil(winSize.width / spSize.width) + 2 do 
    for j = -1 , math.ceil( winSize.height/spSize.height )  + 3 do 
        local sprite = cc.Sprite:create("pic_war_map_a_0000.png")
        node:addChild(sprite)
        sprite:setPosition(i*spSize.width,j*spSize.height)
        sprite:setAnchorPoint(0 ,0)
 end 

image

test sprite

pic_war_map_a_0000

@cx-github
Copy link
Author

cx-github commented Aug 10, 2019

@minggo @JohnCoconut

@JohnCoconut
Copy link
Contributor

On the first look, I guess it has something to do with depth,

node:setRotation3D({x = -25, y = 0, z = 0})

If we change the x value gradually from -20 to -25, we can see the dark area grows.

I will investigate more in the following days.

@cx-github
Copy link
Author

On the first look, I guess it has something to do with depth,

node:setRotation3D({x = -25, y = 0, z = 0})

If we change the x value gradually from -20 to -25, we can see the dark area grows.

I will investigate more in the following days.

we make 3D big map, when move map and setPosition(x,y) , checkVisibility is also not right

@huachangmiao
Copy link
Contributor

checkVisibility is a 2d function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants